#293 global function recognized with file scope (C)

Chris H

ctags detects global function prototypes with file scope.
The definition is detected correctly though...

example code:
int func(int i);

int main ()
return 0;

int func(int i)
return i+1;
ctags output:
func test_func.c /^int func(int i);$/;" p line:1 file: signature:(int i)
main test_func.c /^int main ()$/;" f line:4
func test_func.c /^int func(int i)$/;" f line:9 signature:(int i)


  • Chris H

    Chris H - 2010-10-06

    example code

  • Chris H

    Chris H - 2010-10-07

    I just noticed, that this only happens if it's a *.c file.
    If i save the same code in a *.h file, the function is recognized as global correctly.

    But also, if i declare one of the functions in *.h file static, it's still recognized as global. I know it's unusual to declare functions in a *.h file static but it's a bug after all, isn't it?


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

Sign up for the SourceForge newsletter:

No, thanks