Menu

#345 ctags fails to identify function signature

open
nobody
None
5
2013-02-12
2013-02-12
Anonymous
No

Ctags fails to identify function signatures in C files when all parameters are anonymous and the types are typedefs or macros.

Example: Say that file.c has the following content:
typedef int MyType;
#define MyType2 int

void function1(MyType);
void function2(MyType2);
void function3(MyType var);
void function4(MyType, int);

Let us run the following ctags command:
> ctags --language-force=c --c-kinds=stupx --fields=+S --line-directives=yes --sort=no -f - file.c
MyType file.c /^typedef int MyType;$/;" t file:
function1 file.c /^void function1(MyType);$/;" p file:
function2 file.c /^void function2(MyType2);$/;" p file:
function2 file.c /^void function2(MyType var);$/;" p file: signature:(MyType var)
function3 file.c /^void function3(MyType, int);$/;" p file: signature:(MyType, int)

For function1 and function2 the signature is missing. Note that if works if we add a parameter name, as in function3, or add a parameter with a standard type, as in function4.

Discussion


Log in to post a comment.