"chao liu" <ch*****@uiuc.edu> a écrit dans le message de
news:cf**********@news.ks.uiuc.edu...
hi, all,
Just confused with the following type definition. I will greatly
appreciate your comments on it and especially to explanations
struct prod_token_parm_item;
typedef struct GTY(()) prod_token_parm_item item;
so why there are so many brace following GTY and what's the meaning of
this?
thanks,
Chao
To understand this code you have to run it through the preprocessor.
Normally GTY should be a macro since it is all in uppercase, Traditionally
macros are written all in uppercase.
The first step of a compilation is to run the preprocessor, translating
macros.
Most compilers will answer to
cc -E
or similar, and will write the preprocessor output either into a file
or into the screen.
Then look at the line where you find both the word
"typedef"
and
"prod_token_parm_item"
and verify if this is the correct line.
Then, look at the output, and see what C statement was being
generated.
This is the only way to understand this, or try to find the macro definition
of GTY.
grep GTY *.h
comes to mind.