jessevdk / cldoc

clang based documentation generator for C and C++
GNU General Public License v2.0
553 stars 59 forks source link

C function pointer arguments have no documented type. #85

Closed jordonbiondo closed 9 years ago

jordonbiondo commented 9 years ago

When I generate documentation for C code like this:

/* Sort an array of ints using a comparison function
 * @data The array to sort in place
 * @data_length the length of @data
 * @comparator A function used to compare ints, should return -1, 0, or 1 if the first argument is less than, equal to, or greater than the second argument respectively.
 */
void sort_ints(int* data, int data_length, int(*comparator)(int, int));

void sort_ints(int* data, int data_length, int(*comparator)(int, int)) {
  // do some sorting
}

The function pointer argument has no documented type, it is only displayed as an untyped pointer in the docs. Preferably the argument would be displayed like this:

int(*)(int, int) comparator

instead of just:

*comparator

Here is an image of the currently generated docs: screen shot 2015-02-26 at 12 01 17 pm

jessevdk commented 9 years ago

I've just pushed support for function pointer types. Could you please try again with the latest master and let me know if this resolved your problems?

jessevdk commented 9 years ago

No further information has been provided. I'm closing this. If you still encounter this problem, please feel free to reopen the issue.