Sender: rich AT phekda DOT freeserve DOT co DOT uk Message-ID: <3EA649FE.312DD4CF@phekda.freeserve.co.uk> Date: Wed, 23 Apr 2003 09:08:30 +0100 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: Yet another try on nan in strto{f,d,ld} References: <200304230720 DOT JAA07123 AT lws256 DOT lu DOT erisoft DOT se> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Hello. Martin Stromberg wrote: > > Richard said: [snip] > > > -fstrict-aliasing' > > > Allows the compiler to assume the strictest aliasing rules > > > applicable to the language being compiled. For C (and C++), this > > > activates optimizations based on the type of expressions. In > > > particular, an object of one type is assumed never to reside at > > > the same address as an object of a different type, unless the > > > types are almost the same. For example, an `unsigned int' can > > > alias an `int', but not a `void*' or a `double'. A character type > > > may alias any other type. > > (Sounds to me that "strictly aliased" (gcc term) should be named > strictly UNaliased (my understanding of it).) Yes, that would be a clearer name! The set of strict aliases for something could be a set containing one item (/the/ only pointer to the thing). Maybe strict aliasing was named by some mathematicians? ;) > > Time to get a new mail client, I think. It cut off the last half of my > > message: > > > > The practice of reading from a different union member than the one > > most recently written to (called "type-punning") is common. Even > > with `-fstrict-aliasing', type-punning is allowed, provided the > > memory is accessed through the union type. > > Ah. So the day we turn that one on (it isn't on yet, right?) we need > to add many unions (I suspect we cast pretty much in the source). gcc 3.3 (well, pre-releases) has a new warning option -Wstrict-aliasing, which is enabled by -fstrict-aliasing. This is also included by default in -Wall. -O2 turns on -fstrict-aliasing which turns on -Wstrict-aliasing. So if you use gcc 3.3, you get the warning. Bye, Rich =] -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]