Menu

#105 ctags getting confused by #if 0

closed-fixed
None
5
2006-03-19
2004-12-16
No

Here is a sample C program which confuses ctags. I
think every line in it is significant. Dropping any of
the #ifdefs or the #define makes the problem go away:

#if 0
#define __PROC__
int func1(
#if 0
#endif
)
{
}
#endif

int func2(int a)
{
}

Somehow the opening brace from line 3 doesn't get
ignored and the closing brace does get ignored and
ctags drops out on "int func2(int a)" line with "failed
to find match for '(' at line 11" error.
Granted, having #if 0 in the middle of args list is
weird, but perfeclty legal.

Discussion

  • Mikhail Kruk

    Mikhail Kruk - 2004-12-16

    suggested fix (looks too simple to be correct:)

     
  • Darren Hiebert

    Darren Hiebert - 2005-05-23
    • assigned_to: nobody --> dhiebert
     
  • Darren Hiebert

    Darren Hiebert - 2006-03-19

    Logged In: YES
    user_id=38016

    Problem fixed by patch below. Fix will be in next release.

     
  • Darren Hiebert

    Darren Hiebert - 2006-03-19

    Patch to fix problem

     
  • Darren Hiebert

    Darren Hiebert - 2006-03-19
    • status: open --> closed-fixed
     

Log in to post a comment.