# HG changeset patch # User Eric Blake # Date 1207283869 21600 # Node ID faf4392efa56b3db876e1508a527751cf5b0b372 # Parent dc081233a86843dcf5ebc991479edc33d668e319 Improve strtod bug detection check. * m4/strtod.m4 (gl_FUNC_STRTOD): Also check for hex-float parsing, required for Solaris 10. Reported by Bob Friesenhahn and Nelson H. F. Beebe. Signed-off-by: Eric Blake diff -r dc081233a868 -r faf4392efa56 ChangeLog --- a/ChangeLog Fri Apr 04 04:23:39 2008 +0200 +++ b/ChangeLog Thu Apr 03 22:37:49 2008 -0600 @@ -1,3 +1,10 @@ +2008-04-04 Eric Blake + + Improve strtod bug detection check. + * m4/strtod.m4 (gl_FUNC_STRTOD): Also check for hex-float parsing, + required for Solaris 10. + Reported by Bob Friesenhahn and Nelson H. F. Beebe. + 2008-04-04 Bruno Haible * modules/relocatable-prog-wrapper (Files): Add m4/environ.m4. Needed diff -r dc081233a868 -r faf4392efa56 m4/strtod.m4 --- a/m4/strtod.m4 Fri Apr 04 04:23:39 2008 +0200 +++ b/m4/strtod.m4 Thu Apr 03 22:37:49 2008 -0600 @@ -1,4 +1,4 @@ -# strtod.m4 serial 7 +# strtod.m4 serial 8 dnl Copyright (C) 2002, 2003, 2006, 2007, 2008 Free Software dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation @@ -22,15 +22,23 @@ ]], [[ { /* Older glibc and Cygwin mis-parse "-0x". */ - char *string = "-0x"; + const char *string = "-0x"; char *term; double value = strtod (string, &term); if (1 / value != -HUGE_VAL || term != (string + 2)) return 1; } { + /* Many platforms do not parse hex floats. */ + const char *string = "0XaP+1"; + char *term; + double value = strtod (string, &term); + if (value != 20.0 || term != (string + 6)) + return 1; + } + { /* Many platforms do not parse infinities. */ - char *string = "inf"; + const char *string = "inf"; char *term; double value = strtod (string, &term); if (value != HUGE_VAL || term != (string + 3))