This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: making aliases into the middle of a structure
- To: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Subject: Re: making aliases into the middle of a structure
- From: Zack Weinberg <zack at rabi dot columbia dot edu>
- Date: Thu, 22 Apr 1999 14:30:30 -0400
- cc: egcs at egcs dot cygnus dot com
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