X-Sybari-Space: 00000000 00000000 00000000 00000000 From: Martin Stromberg Message-Id: <200304230720.JAA07123@lws256.lu.erisoft.se> Subject: Re: Yet another try on nan in strto{f,d,ld} To: djgpp-workers AT delorie DOT com Date: Wed, 23 Apr 2003 09:20:38 +0200 (MET DST) In-Reply-To: <3EA5BCC6.CFF7F7DE@phekda.freeserve.co.uk> from "Richard Dawe" at Apr 22, 2003 11:05:58 PM X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Richard said: > > No. But if you're getting the compiler is generating warnings about strict > > aliasing, then it will generate a warning for this case. Below is an extract > > from gcc 3.2.2's manual, as show by "info Invoking 'Optimize Options'". > > > > ... > > > > -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).) > 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). Right, MartinS