This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: type based aliasing again
- To: Bernd Schmidt <bernds AT cygnus.co.uk>
- Subject: Re: type based aliasing again
- From: Alexandre Oliva <oliva AT lsd.ic.unicamp.br>
- Date: 14 Sep 1999 09:44:38 -0300
- Cc: Joe Buck <jbuck AT synopsys.COM>, gcc AT gcc.gnu dot org, rms AT gnu dot org
- References: <Pine.LNX.4.10.9909141328450.20868-100000@biriani.cygnus.co.uk>
On Sep 14, 1999, Bernd Schmidt <bernds@cygnus.co.uk> wrote:
> If, by "cast to union", you mean code of the form
> union foo { double a; int b[2]; };
> double x;
> x = 2.0;
> ((union foo *)&x)->b[1] = 0;
> then this is not even going to work with gcc
But isn't exactly this work-around that we've have been recommending
to the Linux folks? Houston, we have a problem! :-) / 2
How about:
double x;
((union foo *)&x)->a = 2.0;
((union foo *)&x)->b[1] = 0;
Would this work?
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{dcc.unicamp.br,guarana.{org,com}} aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them