Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > how to interpret this c statement

Reply
Thread Tools

how to interpret this c statement

 
 
chao liu
Guest
Posts: n/a
 
      08-07-2004
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


 
Reply With Quote
 
 
 
 
jacob navia
Guest
Posts: n/a
 
      08-07-2004

"chao liu" <(E-Mail Removed)> a Úcrit dans le message de
news:cf3a47$rke$(E-Mail Removed)...
> 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
debug arp output - please help to interpret Igor MamuziŠ Cisco 3 12-21-2004 10:50 AM
MAX+plus II error:Can't interpret indexed name Aliki VHDL 3 09-24-2004 02:50 AM
Re: How to interpret $FORM{} variable ? James Hunt Perl 0 05-19-2004 07:52 PM
Newbie: Can someone help interpret this single line ACL Doc Holliday Cisco 5 12-28-2003 07:37 PM



Advertisments