[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Conditional preprocessor directive confuses global gtags
From: |
Shigio YAMAGUCHI |
Subject: |
Re: Conditional preprocessor directive confuses global gtags |
Date: |
Fri, 29 Mar 2019 11:57:46 +0900 |
Hello,
It should be treated as a bug, I think.
I have added it to the bug list (https://www.gnu.org/software/global/bugs.html).
Thank you!
Regards,
Shigio
2019年3月29日(金) 6:39 Felix Fernandes <address@hidden>:
>
> Hello,
>
> I am using Gnu Global 6.6.3 in the terminal on Mac OS Mojave V. 10.14.3.
>
> From the command line, I issued gtags in a directory with file containing
> j.cc as follows:
>
> #if SWITCH
> void foo(int a[8],
> #else
> void foo(int a[16],
> #endif
> int b)
> {
> a[0] = b;
> }
>
> void bar(int c, int d)
> {
> c = d;
> }
>
> When I then issued "global -f j.cc", from the command line, no tags were
> output.
>
> The problem is because of the unbalanced parentheses in conditional
> preprocessor directive because when j.cc is changed to this, then
> gtags followed by "global -f j.cc" works:
>
> void foo(int a[8],
> int b)
> {
> a[0] = b;
> }
>
> void bar(int c, int d)
> {
> c = d;
> }
>
> In the ctags documentation, I found this explanation for ctags:
> In general, ctags tries to be smart about conditional preprocessor
> directives. If a preprocessor conditional is
> encountered within a statement which defines a tag, ctags follows only the
> first branch of that conditional
>
> Can gtags similarly be made aware of preprocessor switches?
>
> Thanks,
> Felix Fernandes
>
> _______________________________________________
> Bug-global mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/bug-global
--
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint:
26F6 31B4 3D62 4A92 7E6F 1C33 969C 3BE3 89DD A6EB