Gus
Gus

Reputation: 31

How to use Doxygen to document a pointer to a vector of function pointers

I am writing my code in C and I have the following situation:

typedef struct MyStruct {
   /** Some comment */
   int (*const (*FuncList)[])(void);
} MyList;

The Doxygen is returning the following error: Warning: documented symbol `int (*const MyStruct::FuncList' was not declared or defined.

It seens that the Doxygen is not understanding what is a pointer to a vector of function pointers, because if I change to a more simple sentence it works. I can not change the way to write this sentence because my code must be MISRA compliant.

Upvotes: 1

Views: 1291

Answers (1)

doxygen
doxygen

Reputation: 14869

I think you should help doxygen (and the readers of your code) by using some typedefs, e.g.

/** A function pointer */
typedef int (*TFuncPtr)(void);

/** const pointer to an array of TFuncPtr's */
typedef TFuncPtr (*const TFuncList)[];

typedef struct MyStruct {
     /** Some comment */
     TFuncList FuncList;
} MyList;

I'm pretty sure MISRA would agree.

Upvotes: 2

Related Questions