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 <[email protected]>: > > 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 > [email protected] > https://lists.gnu.org/mailman/listinfo/bug-global -- Shigio YAMAGUCHI <[email protected]> PGP fingerprint: 26F6 31B4 3D62 4A92 7E6F 1C33 969C 3BE3 89DD A6EB _______________________________________________ Bug-global mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-global
