Menu

#263 Definition search problem (typedef and pointer to function)

open
nobody
None
5
2012-12-29
2011-03-14
Anonymous
No

When I run cscope-15.7a on the following file (attached):

1 typedef struct
2 {
3 int x;
4 } int_t;
5
6 typedef int (*my_func_t) (
7 int_t x,
8 int_t y,
9 char mode
10 );

and try to find global definition:

Find this global definition: int_t

I get the following result:

Global definition: int_t

File Line
0 my.h 4 } int_t;
1 my.h 7 int_t x,
2 my.h 8 int_t y,

I believe that the correct result should be:

File Line
0 my.h 4 } int_t;

Thanks!

Discussion

  • Hans-Bernhard Broeker

    This is a well-known issue, and largely unrelated to the typedef. The problem is, and always has been, about function pointers. They throw off cscope's parser by having extra parentheses in an awkward place. Typedefed function pointers work marginally better than directly declared ones, but really only marginally.

     

Log in to post a comment.