#49 False "stray ifdef" warning!

closed-invalid
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-invalid
     
  • Malcolm Box

    Malcolm Box - 2002-03-17

    Logged In: YES
    user_id=215386

    Try using a more up-to-date version of lxr - 0.3 is very old
    now and no longer supported.

    More modern versions use ctags to parse the source and so
    don't fall prey to this problem.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks