Search code examples
vimctags

ctags doesn't parse some clib headers


Okay, I've just installed ctags and I've tried to parse the whole C library with ctags like that:

ctags -I__wur --c++-kinds=+p --fields=+iaS -f ~/.tags/tags /usr/include/*.h

It seems, that this line doesn't parse some of the libraries properly. For example if I hit C-] on fclose function, ctags directs me to /usr/include/stdio.h fclose's line and I can see all the info I need about the function. But strange stuff happens with function's prototypes, which are in string.h. For example, if I hit C-] on strcpy, I get the following message:

E426: tag not found: strcpy

So I decided to parse tags file like that:

ctags -R -I__wur --c++-kinds=+p --fields=+iaS -f ~/.tags/tags /usr/include/

Now, if I hit g] on strcpy, I get to choose one of the following files to open:

/usr/include/bits/string.h
/usr/include/bits/string2.h
/usr/include/bits/string3.h

But somehow, I can't see /usr/include/string.h. What's the problem here? Am I using ctags incorrectly, somehow?


Solution

  • I suspect that /usr/include/string.h is actually a symbolic link to /usr/include/bits/stringx.h. ctags is working properly.