New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: macros defined in source no longer expanded (Origin: bugzilla #615695) #3736

Closed
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 2, 2018

status RESOLVED severity major in component general for ---
Reported in version 1.6.3 on platform Other
Assigned to: Dimitri van Heesch

On 2010-04-13 23:15:00 +0000, Mikon Dosogne wrote:

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

On 2010-04-13 23:53:16 +0000, Mikon Dosogne wrote:

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

On 2010-04-15 07:39:52 +0000, Jean Bréfort wrote:

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...

On 2010-04-15 07:48:26 +0000, Jean Bréfort wrote:

Looks like a duplicate of # 611888.

On 2010-04-17 19:27:28 +0000, Dimitri van Heesch wrote:

Confirmed. Should be fixed in the next subversion update.

On 2010-06-15 11:22:35 +0000, Dimitri van Heesch wrote:

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.

@doxygen doxygen closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment