Home > Software design >  Doxygen does not document variables after variable with attribute
Doxygen does not document variables after variable with attribute

Time:05-04

I have a .c file where several variables are declared. One of them has the attribute __align(4), i.e. the declaration is __align(4) static uint32_t myVar;

When I create the doxygen doc for this source file it only lists the variables which are declared prior to __align(4) static uint32_t myVar; (myVar is also not included in the doc).

Example:

uint32_t var1;                     //documented by doxygen
static uint32_t var2;              //documented by doxygen
__align(4) static uint32_t myVar;  //NOT documented by doxygen
uint32_t var4;                     //NOT documented by doxygen

I suspect that doxygen sees that __align() is actually a function and stops looking for variable declarations afterwards.

How do I get doxygen to list all my declared variables? A "hacky" solution would be to declare the aligned variable at the bottom of my variable section but the aligned variable would still not be included in the doc.

Any help is greatly appreciated :)

Greetings

CodePudding user response:

There are a number of points in this question that need attention.

So the complete Doxyfile can look like:

EXTRACT_STATIC=YES
PREDEFINED = __align(x)=
MACRO_EXPANSION = YES

and the source code:

/// \file

/** some docu */
uint32_t var1;                     //documented by doxygen
/** some docu */
static uint32_t var2;              //documented by doxygen
/** some docu */
__align(4) static uint32_t myVar;  //NOT documented by doxygen
/** some docu */
uint32_t var4;                     //NOT documented by doxygen

and all is documented as expected.

  • Related