GNOME Bugzilla – Bug 615695
Regression: macros defined in source no longer expanded
Last modified: 2010-06-15 11:22:35 UTC
Doxygen v1.6.3 introduces a regression in macro expansion; macros that were expanded as expected in v1.5.9 are no longer being expanded. The following options are used: MACRO_EXPANSION=YES EXPAND_ONLY_PREDEF=NO The two macros that fail to expand in the following example: MYCLASSNAME - #defined within the file that uses it, and #undef'd before EOF OPT_ARG(a) - #defined in a separate header and indirectly #included. Doxygen v1.5.9 generates documentation for a class named "TestClass" with a member function "SomeFunc". Doxygen v1.6.3 generates docs for a class named MYCLASSNAME without the member function, and the following error: D:/XT178/VAPSXT_DIR/MacroTest/MacroTest.cpp: 8: Warning: no matching class member found for TestClass::SomeFunc(int arg1OPT_ARGint optional_arg) ---------------------------- FILE "MacroDefs.h" ---------------------------- #define OPTION 1 #if OPTION #define OPT_ARG(arg) ,arg #else #define OPT_ARG(arg) #endif ---------------------------- FILE "MacroTest.h" ---------------------------- #include "MacroDefs.h" #define MYCLASSNAME TestClass /// @brief Test Class class MYCLASSNAME { public: SomeFunc( int arg1 OPT_ARG(int optional_arg) ); }; #undef MYCLASSNAME ---------------------------- FILE "MacroTest.cpp" ---------------------------- #include "MacroTest.h" #define MYCLASSNAME TestClass /// @brief Some function. MYCLASSNAME::SomeFunc( int arg1 OPT_ARG(int arg2) ) {} #undef MYCLASSNAME
The doxygen config file can be reduced to only: MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = NO INPUT = <path/to/files> INCLUDE_PATH = <path/to/files> If I paste the contents of MacroDefs.h at the beginning of MacroTest.h, then OPT_ARG appears in the member function signature of the generated class (not expanded) and the member is still undocumented. The problem still occurs even if the #undefs are commented out. If I add the following line to the doxygen config, the output is as expected: EXPAND_AS_DEFINED = OPT_ARG MYCLASSNAME
I'm seeing that on Linux too. doxygen -d Preprocessor emits a warning for every #include it finds, like: #include config.h: not found or already included! skipping...
Looks like a duplicate of #611888.
Confirmed. Should be fixed in the next subversion update.
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.