bug-gnulib
[Top][All Lists]
Advanced

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

Re: HP-UX 11.31 strtod failure (was: snapshot 3 in preparation for 1.4.


From: Gary V. Vaughan
Subject: Re: HP-UX 11.31 strtod failure (was: snapshot 3 in preparation for 1.4.13)
Date: Wed, 25 Feb 2009 13:03:07 +0700

Hi Eric,

2009/2/24 Eric Blake <address@hidden>:
> 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:

I applied your patch and reran the testsuite everywhere.  It does indeed
fix the problem above and hpux11.31 now passes, however our older non-C99
compilers choke on the declaration after statement.  After this tweak,
no regressions :)

Index: m4/strtod.m4
===================================================================
--- m4/strtod.m4.orig
+++ 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,14 @@ 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;
-    double value = strtod (string, &term);
-    if (value != HUGE_VAL || term != (string + 3))
+    double value;
+    errno = 0;
+    value = strtod (string, &term);
+    if (value != HUGE_VAL || term != (string + 3) || errno)
       return 1;
   }
   {

Cheers,
    Gary
-- 
Email me:          address@hidden                        (\(\
Read my blog:      http://blog.azazil.net              ( o.O)
And my other blog: http://www.machaxor.net              (uu )o
...and my book:    http://sources.redhat.com/autobook  ("("_)




reply via email to

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