Eric Blake wrote: > test-strtod.c is all I had; but I intentionally made it catch all errors > rather than aborting on the first
Ah, I see. Sorry, I had not seen this detail. Find attached the results on a dozen of platforms. I integrated these test results into test-strtod.c as comments (since we don't yet have a matrix like in m4/printf.m4), using a script like this: sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* glibc-2.3.6 */|;},' < test-strtod-glibc-2.3.6 > sed1 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* MacOS X 10.3 */|;},' < test-strtod-macosx-10.3.9 > sed2 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* FreeBSD 6.2 */|;},' < test-strtod-freebsd-6.2 > sed3 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* NetBSD 3.0 */|;},' < test-strtod-netbsd-3.0 > sed4 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* OpenBSD 4.0 */|;},' < test-strtod-openbsd-4.0 > sed5 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* AIX 4.3 */|;},' < test-strtod-aix-4.3.2 > sed6 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* AIX 5.1 */|;},' < test-strtod-aix-5.1 > sed7 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* HP-UX 11.00 */|;},' < test-strtod-hpux-11.00 > sed8 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* HP-UX 11.11 */|;},' < test-strtod-hpux-11.11 > sed9 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* IRIX 6.5 */|;},' < test-strtod-irix-6.5 > sed10 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* OSF/1 4.0 */|;},' < test-strtod-osf1-4.0d > sed11 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* OSF/1 5.1 */|;},' < test-strtod-osf1-5.1 > sed12 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* Solaris 2.4 */|;},' < test-strtod-solaris-2.4 > sed13 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* Solaris 2.5.1 */|;},' < test-strtod-solaris-2.5.1 > sed14 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* Solaris 9 */|;},' < test-strtod-solaris-2.9 > sed15 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* Solaris 10 */|;},' < test-strtod-solaris-2.10 > sed16 sed -e 's,test-strtod.c:,,' -e 's,: assertion failed,{s|$| /* mingw */|;},' < test-strtod-mingw > sed17 cat gnulib-git/tests/test-strtod.c \ | sed -f sed1 | sed -f sed2 | sed -f sed3 | sed -f sed4 | sed -f sed5 \ | sed -f sed6 | sed -f sed7 | sed -f sed8 | sed -f sed9 | sed -f sed10 \ | sed -f sed11 | sed -f sed12 | sed -f sed13 | sed -f sed14 | sed -f sed15 \ | sed -f sed16 | sed -f sed17 > gnulib-git/tests/test-strtod.c.new Then I also updated the doc accordingly. Notable disagreements: - I could not see an indication of the "returns a wrong end pointer on some platforms: Solaris 2.4" problem, so I removed this; - You seem to have seen problems on Solaris 8 that I did not see. What can be the reason? Did you use gnulib's signbit and isnan functions? I used the ones from the system, or trivial platform-specific replacements. - Changed wording: 0.0 is not considered a "positive value". The usual definition of "positive" is "x > 0", and "negative" is "x < 0". Yes, a "negative zero" is not negative; that's actually a misnomer. 2008-03-30 Bruno Haible <[EMAIL PROTECTED]> * tests/test-strtod.c: Add comments about which assertion fails on which platform. * doc/posix-functions/strtod.texi: Add info about many more platforms. --- doc/posix-functions/strtod.texi.orig 2008-03-31 01:56:47.000000000 +0200 +++ doc/posix-functions/strtod.texi 2008-03-31 01:56:40.000000000 +0200 @@ -16,53 +16,52 @@ Old versions of Linux. @item -This function returns a wrong end pointer on some platforms: -Solaris 2.4. +This function returns a wrong end pointer on some old platforms. @item This function fails to do a valid parse of @samp{-0x} on some platforms: -glibc 2.4, Cygwin < 1.5.25-11. +glibc 2.4, MacOS X 10.3, FreeBSD 6.2, Cygwin < 1.5.25-11. @item This function fails to parse Infinities and plain NaNs on some platforms: -Solaris 8, Mingw, OpenBSD 4.0. +OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 9, mingw. @item This function fails to parse NaN() on some platforms: -Solaris 8, Mingw, OpenBSD 4.0, Cygwin < 1.5.25-11. +glibc-2.3.6, MacOS X 10.3, FreeBSD 6.2, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris?, Cygwin < 1.5.25-11, mingw. @item This function fails to parse NaN(n-char-sequence) on some platforms: -Solaris 8, Mingw, OpenBSD 4.0. +OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris?, mingw. @item This function returns the wrong end pointer when parsing NaN(n-char-sequence) on some platforms: -glibc 2.4. +glibc-2.4, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris?, mingw. @item This function fails to parse C99 hexadecimal floating point on some platforms: -Solaris 8, Mingw, OpenBSD 4.0. +NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw. @end itemize Portability problems not fixed by Gnulib: @itemize @item -This function returns a positive value for negative underflow on some +This function returns +0.0 (not -0.0) for negative underflow on some platforms: -glibc 2.7, Mingw, Cygwin. +glibc 2.7, Cygwin, mingw. @item This function cannot distinguish between ``nan'' and ``-nan'' on some platforms: -glibc 2.7. +glibc 2.7, IRIX 6.5, OSF/1 5.1, mingw. @item This function fails to correctly parse very long strings on some platforms: -Mingw, Cygwin. +MacOS X 10.3, FreeBSD 6.2, NetBSD 3.0, OpenBSD 4.0, IRIX 6.5, OSF/1 5.1, Cygwin, mingw. @item The replacement function does not always return correctly rounded results.
test-strtod.tar.gz
Description: application/tgz