GNOME Bugzilla – Bug 643056
Error parsing macros (MACRO_EXPANSION)
Last modified: 2012-11-18 11:11:38 UTC
Created attachment 181682 [details] Example doxgygen config and source with a badly parsed macro After moving to Release_1_7_3_20110217 I have started getting: warning: Found ';' while parsing initializer list! (doxygen could be confused by a macro call without semicolon) .. where I have a macro that defines one or more generic C++ class members, and then use that macro in the class specification. This doesn't happen in trivial cases, but seems to be something to do with the macro definition coming from another file. If, in the attached erring example, the [unrelated] file C.h is moved out of the way, then the error doesn't occur. A build of the above with some printf() debug re-enabled seems to show the macro being processed *after* its first reference: /tmp/doxygen-error/src/M.h:23: warning: Found ';' while parsing initializer list! (doxygen could be confused by a macro call without semicolon) newDefine: MINSTUFF->X.h newDefine: `MINSTUFF'->`virtual int *To( int *, const int& = 0 ) const { return NULL; } virtual bool From( const int* ) { return true; }' Further testing shows this to be a regression in Release_1_7_3_20110217; Release_1_7_3_20110123 is OK.
Actually, that last bit's not strictly true. This example seems to be OK with the older version, but there's still one being reported in my full code, where two similar such macros appear one after another.
Confirmed. This bug was introduced by applying the patch in bug 641346, so I need to come up with a better solution.
Hi Dimitri, I did some debugging for the issue. The problem seems that for a complete project, an include file is scanned only once. After applying the patch of bug 641346, where define dictionary is cleared before processing of a file. The defines from include are available for first file that includes it. For rest of file including it there is no define. I think include dictionary should also be cleared before processing of a file. So, that an include file is scanned for every file that includes it. PATCH ===== --- src/pre.l 2011-03-11 10:59:18.321049000 +0530 +++ /delsoft/harpreet/software/doxygen-1.7.3/src/pre.l 2011-02-03 15:54:49.878117000 +0530 @@ -2500,7 +2500,6 @@ g_inputBuf=&input; g_inputBufPos=0; g_outputBuf=&output; - g_allIncludes.clear(); g_includeStack.setAutoDelete(TRUE); g_includeStack.clear(); g_expandedDict->setAutoDelete(FALSE); Regards, Harpreet Singh
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.7.4. 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.