Re: One-liner breaks "strtold" in XCode 2.4
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Nov 28, 2006, at 6:18 PM, Jay Reynolds Freeman wrote: My code establishes that a numeric string which manifestly is not a nan is interpreted as a nan by "strtold". I am running on a Macbook 1,1 with OS 10.4.8. The version of gcc is that which came with the download of XCode 2.4.1, which is gcc-4.0; however, I believe the problem is in a library which is not part of gcc per se. I think the library is provided by Apple. I have done a google search for information about this bug, and turned up some possible reports that the bug may be related to the fact that "long doubles" are in IEEE 80-bit format on the Macbook. Reports indicate that in architectures using IEEE 64-bit format for long double, the problem does not occur. Thus if you try to duplicate my bug, your mileage may vary depending on what processor you are using. In particular, if your compiler reports that sizeof( long double ) is 8 bytes, you may not see the bug. (IEEE 80-bits take at least 10 bytes, and maybe more if data must be word-aligned.) -Eric _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... On Intel processors, Mac OS X uses an 80-bit long double, stuffed in a 16-byte data type in which 6 bytes are ignored. Whether it's an IEEE-754 format or not isn't something I know enough to comment on, but it's Intel's native 80-bit floating point type. If you think there's a bug in the strtold implementation on Mac OS X, the best thing to do is to file a bug report with a reproducible test case at <http://bugreport.apple.com/>. This email sent to site_archiver@lists.apple.com
participants (1)
-
Eric Albert