GNOME Bugzilla – Bug 614443
Doxygen 'forgets' #define documentation under certain conditions
Last modified: 2010-06-15 11:22:01 UTC
Doxygen 'forgets' the documentation of defines under certain conditions. Example: 1. Create a file test.h with this content: /// @defgroup Test /// @{ /// macro BAR #ifndef BAR #define BAR someFunction(x) #endif /// macro Foo #define FOO 42 /// @} /// @page page1 /// Use @ref FOO 2. Create an default configuration file using: doxygen -g 3. In Doxfile, set: INPUT = test.h 4. Run doxygen: doxygen Doxygen complains: D:/test.h:17: Warning: unable to resolve reference to `FOO' for \ref command In the generated documentation the both macro BAR and FOO are missing. Note: - the problem does not occur for doxygen version 1.6.2. - the problem also occurs in the SVN version 1.6.3-20100324. - the problem disappears if the BAR macro gets slightly modified (remove the #ifdef, replace #ifndef BAR by #ifndef BAR2 or just change the macro definition to '#define BAR 123'
The main problem is that the header file does not have an include guard and the more relaxed heuristics added to doxygen recently now see the BAR construct as an include guard, hence ignoring it. This was changed to support include guards of the form #ifndef BLA_H #define BLA_H 1 ... #endif used by some people. I'll make the heuristics a bit more strict so that your case will not been seen as an include guard anymore, but I suggest to always add include guards to your header files.
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.7.0. Please verify if this is indeed the case. Reopen the bug if you think it is not fixed and please include any additional information that you think can be relevant.