Den 14-Sep-99 13:44:38 skrev Alexandre Oliva følgende om "Re: type based aliasing again": > On Sep 14, 1999, Bernd Schmidt 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 The recommendation in the GCC manual, if that is anything to go by, is not to "cast to union" but to use a union. I.e. something like union foo { double a; int b[2]; }; foo.a = 2.0; foo.b[1] = 0; This is documented to work, actually works, is shorter, is not write-only, etc. Regards, /¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯T¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\ | Rask Ingemann Lambertsen | E-mail: mailto:rask@kampsax.k-net.dk | | Registered Phase5 developer | WWW: http://www.gbar.dtu.dk/~c948374/ | | A4000, 866 kkeys/s (RC5-64) | "ThrustMe" on XPilot, ARCnet and IRC | | If a train station is where a train stops, what is a workstation then? |