Skip to content
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

Error parsing macros (MACRO_EXPANSION) (Origin: bugzilla #643056) #4169

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

Error parsing macros (MACRO_EXPANSION) (Origin: bugzilla #643056) #4169

doxygen opened this issue Jul 2, 2018 · 0 comments

Comments

@doxygen
Copy link
Owner

doxygen commented Jul 2, 2018

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

Original attachment names and IDs:

On 2011-02-23 11:50:37 +0000, Neil Bird wrote:

Created attachment 181682
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.

On 2011-02-23 12:04:00 +0000, Neil Bird wrote:

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.

On 2011-02-23 20:06:37 +0000, Dimitri van Heesch wrote:

Confirmed. This bug was introduced by applying the patch in bug 641346, so I need to come up with a better solution.

On 2011-03-11 05:37:00 +0000, Harpreet wrote:

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

On 2011-03-28 14:18:50 +0000, Dimitri van Heesch wrote:

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.

@doxygen doxygen closed this as completed Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant