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 643056 - Error parsing macros (MACRO_EXPANSION)
Error parsing macros (MACRO_EXPANSION)
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2011-02-23 11:50 UTC by Neil Bird
Modified: 2012-11-18 11:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example doxgygen config and source with a badly parsed macro (20.83 KB, application/x-compressed-tar)
2011-02-23 11:50 UTC, Neil Bird
Details

Description Neil Bird 2011-02-23 11:50:37 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.
Comment 1 Neil Bird 2011-02-23 12:04:00 UTC
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.
Comment 2 Dimitri van Heesch 2011-02-23 20:06:37 UTC
Confirmed. This bug was introduced by applying the patch in bug 641346, so I need to come up with a better solution.
Comment 3 Harpreet 2011-03-11 05:37:00 UTC
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
Comment 4 Dimitri van Heesch 2011-03-28 14:18:50 UTC
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.