From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <69984b38f4ce67c8d69c244d94fafe3b.axp-list@archive.invalid> X-Archive-Original-Message-ID: <199710071733.NAA06819@linux03.amt.tay1.dec.com> Date: =?ISO-8859-1?Q?Tue=2C_7_Oct_1997_22=3A19=3A58_+0200_=28xy=92U?= From: Volker Barthelmann Subject: Re: axp/gcc the double cast gets trashed on return ( really a GDB BUG ) In-Reply-To: <343A30B1.CD60EA8F@voicenet.com> On Tue, 7 Oct 1997, Uncle George wrote: > > The code is basically broken. Reading another member of a union than the > > one which was last written causes implementation defined behaviour (IMHO > > it should even be undefined behaviour). > > This is not a broken feature, but rather a porting implimentation problem. The > long on alpha is 64 bit, the double on a alpha is 64 bit. a union would make the > space ONE. in reality quite a few people do this for the exact same reasons, so > long as u understand how things are getting stored ( including packed/unpacked > structs!) It is not enough to know the exact representation of the data-types. You are depending on how some things work inside the compiler. There are compilers which will break such code no matter how the data is stored. gcc may not do this, but gcc is extremely conservative in handling aliasing. Compilers with more aggressive optimizers or even a future version of gcc might break such code. Volker -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com