Ctags: C: A function is detected as variable

Created on 29 Jun 2016  ·  3Comments  ·  Source: universal-ctags/ctags

Hello,

The ctags e5b7a2508db6e1374ea78a300cc9b45f4b26b02a detects a function as variable in the header epan/except.h of the Wireshark library:

WS_DLL_PUBLIC void (*except_unhandled_catcher(void (*)(except_t *)))(except_t *);

The command

ctags -x --c-kinds=fpvx --language-force=c epan/except.h | grep except_unhandled_catcher

returns:

except_t variable 100 epan/except.h WS_DLL_PUBLIC void (*except_unhandled_catcher(void (*)(except_t *)))(except_t *);

However it's a function except_unhandled_catcher (both return value type and parameter type are function pointers).

Thank you.

Parser buenhancement

Most helpful comment

jeez... this syntax is hard :D
I'll try to make sense of it.

All 3 comments

I can confirm this, and that the old C parser got that one right. Ignoring/removing WS_DLL_PUBLIC doesn't change anything in either case.

$ ./ctags -x --OldC-kinds=+pv --languages=OldC /tmp/1012.c
except_unhandled_catcher prototype     1 /tmp/1012.c      WS_DLL_PUBLIC void (*except_unhandled_catcher(void (*)(except_t *)))(except_t *);

jeez... this syntax is hard :D
I'll try to make sense of it.

This should be fixed by #1119.

Was this page helpful?
0 / 5 - 0 ratings