bug-gnulib
[Top][All Lists]
Advanced

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

Re: lib/regex_internal.h on 1.4.11


From: Eric Blake
Subject: Re: lib/regex_internal.h on 1.4.11
Date: Fri, 12 Sep 2008 06:53:38 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666

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

According to Bruno Haible on 8/1/2008 3:30 AM:
> Jonathan C. Patschke wrote:
>> That fixes the problem in test-frexp and test-strtod, but not test-frexpl
>> (which still fails the (mantissa == x) assertion).
> 
> Thanks. I'm applying the patch below, assuming that if the compiler
> confuses -0.0 with 0.0, it also confuses -0.0L with 0.0, and -0.0f with 0.0f.

> 2008-08-01  Bruno Haible  <address@hidden>
>
>       Work around bug of HP-UX 10.20 cc with -0.0 literal.
>       * tests/test-isnanf.h (zero): New variable.
>       (main): Avoid literal -0.0f.
...

It looks like you failed to check .m4 tests.  I'm applying the patch
below.  Meanwhile, I have a question about tests/test-signbit.c - your
patch changed most occurrences of -0.0L to -zerol, to work around one HP
bug, but there is another comment that states:

/* We cannot use the expression '-zerol' here, because on HP-UX/hppa it
   evaluates to 0.0L, not -0.0L.  */
long double minus_zerol = -0.0L;

and still uses minus_zerol throughout the file.  So which is it, or are we
really stuck with no portable way to represent negative zero across the
spectrum of HP compilers/architectures?

- --
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

iEYEARECAAYFAkjKZlEACgkQ84KuGfSFAYAhZgCgqfEX2V8buuyLXcw/TwrlqTKx
CcgAn3SmvXWZ643iPXW2zFeJzytV5JRi
=dVsh
-----END PGP SIGNATURE-----
>From b5664d94a7ab12c880505b39519743fd5df66c63 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Fri, 12 Sep 2008 06:30:32 -0600
Subject: [PATCH] signbit: work around bug of HP-UX 10.20 cc with -0.0 literal

* m4/signbit.m4 (gl_SIGNBIT_TEST_PROGRAM): Rewrite test to avoid
literal -0.0.
Reported by Jonathan C. Patschke <address@hidden>.

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

diff --git a/ChangeLog b/ChangeLog
index c895a9b..bf7fcc9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-09-12  Eric Blake  <address@hidden>
+
+       signbit: work around bug of HP-UX 10.20 cc with -0.0 literal
+       * m4/signbit.m4 (gl_SIGNBIT_TEST_PROGRAM): Rewrite test to avoid
+       literal -0.0.
+       Reported by Jonathan C. Patschke <address@hidden>.
+
 2008-09-11  Yoann Vandoorselaere  <address@hidden>
 
        * lib/glthread/cond.h: Use dummy implementation also if
diff --git a/m4/signbit.m4 b/m4/signbit.m4
index 152a32e..1748453 100644
--- a/m4/signbit.m4
+++ b/m4/signbit.m4
@@ -124,12 +124,14 @@ AC_DEFUN([gl_SIGNBIT],
 ])
 
 AC_DEFUN([gl_SIGNBIT_TEST_PROGRAM], [
+/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
+   So we use -p0f instead.  */
 float p0f = 0.0f;
-float m0f = -0.0f;
+float m0f = -p0f;
 double p0d = 0.0;
-double m0d = -0.0;
+double m0d = -p0d;
 long double p0l = 0.0L;
-long double m0l = -0.0L;
+long double m0l = -p0l;
 int main ()
 {
   {
-- 
1.6.0


reply via email to

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