This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: "lang_statement_union_type and its usage?"


Hi Ian,

Ian Lance Taylor wrote:

 
> 
> All elements of lang_statement_union start with
>   lang_statement_header_type header;
> The first field in lang_statement_header_type is
>   union lang_statement_union *next;
> 
> Therefore, in all cases, the first field in any instance of
> lang_statement_union will be the next pointer.
> 
> This is a pretty common hack when implementing derived classes in C.
> 
> Ian

   I see. However, this may not work if some optimizing compilers
would change the relative order of the `next' field. I.e., this scheme
is compiler-dependent.

Thanks

-- 
Dr. Xinan Tang                    Member of Technical Staff
EMail: xinant@cognigine.com  	  Cognigine Corp.
Voice: 510.743.4930               6120 Stevenson Boulevard
Fax:   510.743.4910               Fremont, CA  94538


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]