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.
- there is no documentation at all in the example, so we either need the setting
EXTRAC_ALL=YES
(see https://www.doxygen.nl/manual/config.html#cfg_extract_all) or document the variables - a number of variables are
static
, this implies that we also need the settingEXTRACT_STATIC=YES
(see https://www.doxygen.nl/manual/config.html#cfg_extract_static) - the declaration of
myVar
has the non-standard attribute__align
and this has to be handled in a similar way as the attribute__attribute__
, see https://www.doxygen.nl/manual/preprocessing.html) so:PREDEFINED = __align(x)=
MACRO_EXPANSION = YES
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.