#213 C/C++: functions not recognized if args contain a macro call

closed-invalid
None
5
2008-03-17
2008-03-03
Tim Vanderhoek
No

In the example code below

/* Macro to produce some complex structure from x */
#define LIST(x) x
void func1(float x, float y)
{
}
void func2(LIST(float) x, LIST(float) y)
{
}

The old version of emacs ctags that I tested, as well as the FreeBSD ctags, both recognize both func1 and func2, and place entries for them in the tags file. Exuberant ctags, however, does NOT recognize func2.

I tend think that the behaviour for the other two ctags programs is correct and that the Exuberant Ctags behaviour is wrong.

Discussion

  • Elliott Hughes
    Elliott Hughes
    2008-03-17

    Logged In: YES
    user_id=1127237
    Originator: NO

    not a bug. see the documentation for -I in the manual.

    lithium:/tmp$ cat x.cpp
    /* Macro to produce some complex structure from x */
    #define LIST(x) x
    void func1(float x, float y)
    {
    }
    void func2(LIST(float) x, LIST(float) y)
    {
    }
    lithium:/tmp$ ctags -n -o - x.cpp
    LIST x.cpp 2;" d file:
    func1 x.cpp 3;" f
    lithium:/tmp$ ctags -n -o - -ILIST x.cpp
    LIST x.cpp 2;" d file:
    func1 x.cpp 3;" f
    func2 x.cpp 6;" f
    lithium:/tmp$

     
  • Elliott Hughes
    Elliott Hughes
    2008-03-17

    • assigned_to: nobody --> elliotth
    • status: open --> closed-invalid