This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: making aliases into the middle of a structure


On 22 Apr 1999 15:24:46 -0300, Alexandre Oliva wrote:
>On Apr 22, 1999, Zack Weinberg <zack@rabi.columbia.edu> wrote:
>
>> extern __typeof(x.b) y __attribute__ ((alias("x.b")));
>
>This can't work.  The alias attribute defines an alias to a *symbol*,
>not to an arbitrary expression. 

I don't see that it would be terribly hard to extend alias so it could
handle SYMBOL_REFs and COMPONENT_REFs as well as strings.

>Since you may have to get quite
>platform-specific because of the potential need for leading
>underscores, 

This is already handled in the real framework; the above was a
stripped down example.

>why don't you compute the offset, say, in the configure
>script, then #define the appropriate alias string?

Because the preprocessor can't compute offsetof() all the way down;
I'd have to compile and run a test program.  Which loses when
cross-compiling.

zw


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