[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: With a wacky macro before it, 'global' appears to miss a function
From: |
Shigio YAMAGUCHI |
Subject: |
Re: With a wacky macro before it, 'global' appears to miss a function |
Date: |
Sun, 24 Apr 2011 08:26:58 +0900 |
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)
> address@hidden 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:
> address@hidden 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 <address@hidden>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663 C4B6 3CA5 BBB3 57BE DDA3
- Re: With a wacky macro before it, 'global' appears to miss a function, Ezolt, Phillip, 2011/04/24
- Re: With a wacky macro before it, 'global' appears to miss a function, Shigio YAMAGUCHI, 2011/04/24
- Re: With a wacky macro before it, 'global' appears to miss a function, Phillip Ezolt, 2011/04/25
- Re: With a wacky macro before it, 'global' appears to miss a function, Shigio YAMAGUCHI, 2011/04/26
- Re: With a wacky macro before it, 'global' appears to miss a function, Marc Herbert, 2011/04/27
- Re: With a wacky macro before it, 'global' appears to miss a function, Shigio YAMAGUCHI, 2011/04/27
- Re: With a wacky macro before it, 'global' appears to miss a function, Ezolt, Phillip, 2011/04/27