Search code examples
cstructdoxygen

Doxygen document struct members with attributes


I have a struct with one of its fields annotated with gcc type attribute.

struct str {
    size_t size; /**< Size of string. */
    char string[1] __attribute__ ((aligned(__BIGGEST_ALIGNMENT__))); /**< String. */
};

When I run doxygen on this code, struct member string is referenced not as Data Field, but as a Public Member Function. How do I make doxygen list this field as a Data Field?

P.S. I have string OPTIMIZE_OUTPUT_FOR_C = YES present in my Doxyfile.


Solution

  • In case it is correct that for the documentation the line

    char string[1] __attribute__ ((aligned(__BIGGEST_ALIGNMENT__)));

    can be

    char string[1];

    It would be sufficient to define in the doxygen configuration file:

    PREDEFINED = __attribute__((x))=