After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 615695 - Regression: macros defined in source no longer expanded
Regression: macros defined in source no longer expanded
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.6.3
Other All
: Normal major
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2010-04-13 23:15 UTC by Mikon Dosogne
Modified: 2010-06-15 11:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mikon Dosogne 2010-04-13 23:15:00 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
Comment 1 Mikon Dosogne 2010-04-13 23:53:16 UTC
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
Comment 2 Jean Bréfort 2010-04-15 07:39:52 UTC
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...
Comment 3 Jean Bréfort 2010-04-15 07:48:26 UTC
Looks like a duplicate of #611888.
Comment 4 Dimitri van Heesch 2010-04-17 19:27:28 UTC
Confirmed. Should be fixed in the next subversion update.
Comment 5 Dimitri van Heesch 2010-06-15 11:22:35 UTC
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.