#50 False "stray ifdef" warning!

closed-out-of-date
nobody
genxref (49)
5
2002-03-17
2002-03-14
Anonymous
No

Hi Lxr folks!

I'm running genxref from the Debian unstable 0.3-2
version of lxr and I got some "stray ifdef" that
does not look like bad ifdef's in the code. For
example if I run genxref on this _C++_ program:

#if 1
//*
#endif
/**/

Then the program thinks the #endif is in a C style
comment and ignore it!

The problem seems to disappera if I change the
genxref code lines:

\# Remove comments.
$contents =~ s/\/\\\*\(.\*?\)\\\*\//&wash\($1\)/ges;
$contents =~ s/\/\/\[^\n\]\*//g; \# C++

to

\# Remove comments.
$contents =~ s/\/\/\[^\n\]\*//g; \# C++
$contents =~ s/\/\\\*\(.\*?\)\\\*\//&wash\($1\)/ges;

i.e. checks for C++ comments beore C comments.

Best regards
/Anders E Larsson

Discussion

  • Malcolm Box
    Malcolm Box
    2002-03-17

    • summary: False "stray ifdef" warning! --> False "stray ifdef" warning!
    • status: open --> closed-out-of-date