[Mono-devel-list] aliasing problem in strtod

Laurent Morichetti l_m at pacbell.net
Fri Nov 7 20:32:04 EST 2003

The macros word0() and word1() violate the ANSI C rule about accessing an object using a type other than what it was declared with. If compiled -O2 with gcc3.3, strtod returns incorrect results (Single.MaxValue for example)
The solution is to either compile mono with -fno-strict-aliasing or to fix the word0() word1() macros by wrapping the double in a union.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20031107/85a627ae/attachment.html 

More information about the Mono-devel-list mailing list