Hello,
Thank you for the bug report.
To solve the problem, I would like to add a new rule like follows:
(In C parser)
A function definition must not have blank lines between the first "(" and the
first "{".
o An example that is a definition.
int main(int argc, char *argv[])
{ <= blank lines don't exist.
printf("Hello\n");
}
o An example that is not a definition.
int main(int argc, char *argv[])
<= blank lines exist.
{
printf("Hello\n");
}
The difference of the two is whether there are blank lines between
"main(" and the first "{".
What do you think?
> If there is a wacky macro before a function, it appears as if global
> misses the functions after it.
>
> Sample:
> test.c:
>
> #define STRUCT_DEF_MACRO(name, type) \
> struct name { \
> struct type *first; \
> }
>
> STRUCT_DEF_MACRO(my_struct, int) struct_instance_name;
>
> void test_func(long dummy1, long dummy2)
> {
>
> }
>
> .....
> Current behavior: (NOTICE: test_func is missing from the display)
> [ezolt@cyclptc11 test]$ ../global-5.9.4/gtags/gtags ; ../global-5.9.4/
> global/global -f test.c
> STRUCT_DEF_MACRO 1 test.c #define STRUCT_DEF_MACRO(name,
> type) \
> name 2 test.c struct name {
> \
> STRUCT_DEF_MACRO 6 test.c STRUCT_DEF_MACRO(my_struct,
> int) struct_instance_name;
>
>
> Expected Behavior:
> [ezolt@cyclptc11 test]$ ../global-5.9.4/gtags/gtags ; ../global-5.9.4/
> global/global -f test.c
> STRUCT_DEF_MACRO 1 test.c #define STRUCT_DEF_MACRO(name,
> type) \
> name 2 test.c struct name {
> \
> test_func 8 test.c void test_func(long dummy1,
> long dummy2)
>
>
> (NOTE: If you comment out the call to 'STRUCT_DEF_MACRO', things
> behave as expected..)
>
> Cheers,
> --Phil
--
Shigio YAMAGUCHI <[email protected]>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663 C4B6 3CA5 BBB3 57BE DDA3
_______________________________________________
Bug-global mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-global