bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

HP-UX 11.31 strtod failure (was: snapshot 3 in preparation for 1.4.13)


From: Eric Blake
Subject: HP-UX 11.31 strtod failure (was: snapshot 3 in preparation for 1.4.13)
Date: Tue, 24 Feb 2009 06:19:01 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Gary V. Vaughan on 2/23/2009 7:39 PM:
> ia64-hp-hpux11.31-acc622      m4 tests pass, gnulib fails: test-strtod
>   test-strtod.c:386: assertion failed
>   test-strtod.c:387: assertion failed
>   test-strtod.c:559: assertion failed
>   test-strtod.c:569: assertion failed
>   test-strtod.c:579: assertion failed
>   test-strtod.c:589: assertion failed
>   test-strtod.c:599: assertion failed
>   test-strtod.c:623: assertion failed
>   test-strtod.c:649: assertion failed
>   test-strtod.c:679: assertion failed
>   test-strtod.c:699: assertion failed
>   test-strtod.c:729: assertion failed

Many of these failures were also documented as HP-UX 11.11 bugs
(mis-parsing "1e 2", wrongly setting errno when parsing "inf").  But
obviously, this newer HP-UX fixed many strtod bugs and got closer to C99
compliance, such that it was no longer being detected by the .m4 filter
test.  I'm committing this, to beef up the .m4 check:

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmj88UACgkQ84KuGfSFAYCWywCgj/fxj2wUaavpuT+oaC1NnMWC
4s8AoJ5fE0QrQMGBhH2vLUWCvVSIXO0B
=XwQB
-----END PGP SIGNATURE-----
From 61c74776c4a0dc5faa23dbc1ad0f9dd23bf14521 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Tue, 24 Feb 2009 06:15:59 -0700
Subject: [PATCH] strtod: detect HP-UX 11.31 bug

* m4/strtod.m4 (gl_FUNC_STRTOD): Detect errno handling bug.
Reported by Gary V. Vaughan.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog    |    6 ++++++
 m4/strtod.m4 |    9 ++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ec08cde..2338272 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-02-24  Eric Blake  <address@hidden>
+
+       strtod: detect HP-UX 11.31 bug
+       * m4/strtod.m4 (gl_FUNC_STRTOD): Detect errno handling bug.
+       Reported by Gary V. Vaughan.
+
 2009-02-23  Bruno Haible  <address@hidden>

        Fix invalid read past end of memory block.
diff --git a/m4/strtod.m4 b/m4/strtod.m4
index caaaa4b..1f301c2 100644
--- a/m4/strtod.m4
+++ b/m4/strtod.m4
@@ -1,4 +1,4 @@
-# strtod.m4 serial 10
+# strtod.m4 serial 11
 dnl Copyright (C) 2002-2003, 2006-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -18,6 +18,7 @@ AC_DEFUN([gl_FUNC_STRTOD],
       [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
 #include <stdlib.h>
 #include <math.h>
+#include <errno.h>
 /* Compare two numbers with ==.
    This is a separate function because IRIX 6.5 "cc -O" miscompiles an
    'x == x' test.  */
@@ -45,11 +46,13 @@ numeric_equal (double x, double y)
       return 1;
   }
   {
-    /* Many platforms do not parse infinities.  */
+    /* Many platforms do not parse infinities.  HP-UX 11.31 parses inf,
+       but mistakenly sets errno.  */
     const char *string = "inf";
     char *term;
+    errno = 0;
     double value = strtod (string, &term);
-    if (value != HUGE_VAL || term != (string + 3))
+    if (value != HUGE_VAL || term != (string + 3) || errno)
       return 1;
   }
   {
-- 
1.6.1.2


reply via email to

[Prev in Thread] Current Thread [Next in Thread]