I think I have come across a bug in how C declarations are parsed, specifically qualified pointer declarations and 'left hand rule' declarations. For example, the following declarations:
static struct syscon_ volatile *volatile syscon; static volatile struct syscon_ *syscon1; static volatile struct syscon_ *const syscon2; static struct syscon_ volatile *syscon3;
produce the following tags (ctags args: --languages=C --c-kinds=+cdefgmpstuvx --fields=+KmnSt --extra=+q):
syscon src/syscon.c /^static struct syscon_ volatile *volatile syscon;$/;" variable line:90 file: syscon1 src/syscon.c /^static volatile struct syscon_ *syscon1;$/;" variable line:95 typeref:struct:syscon_ file: syscon2 src/syscon.c /^static volatile struct syscon_ *const syscon2;$/;" variable line:96 file: syscon3 src/syscon.c /^static struct syscon_ volatile *syscon3;$/;" variable line:97 file:
The typeref information is only correct for syscon1
, ergo, I only get struct member completion for syscon1. Is this a known issue? I believe my assumptions to be correct, but if I am doing something glaringly, obviously wrong, please let know. I'm happy to provide any further information, as required.
Exuberant Ctags version: 5.8, compiled with +wildcards, +regex
OS: FreeBSD 10.2-RELEASE
Extras: Using exuberant ctags with omnicomplete in vim.
Newly introduced C++ parser in Universal-ctags can generate better result: