signbit: work around bug of HP-UX 10.20 cc with -0.0 literal
authorEric Blake <ebb9@byu.net>
Fri, 12 Sep 2008 12:30:32 +0000 (06:30 -0600)
committerEric Blake <ebb9@byu.net>
Fri, 12 Sep 2008 12:32:34 +0000 (06:32 -0600)
* m4/signbit.m4 (gl_SIGNBIT_TEST_PROGRAM): Rewrite test to avoid
literal -0.0.
Reported by Jonathan C. Patschke <jp@centtech.com>.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
m4/signbit.m4

index c895a9b..bf7fcc9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-09-12  Eric Blake  <ebb9@byu.net>
+
+       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 <jp@centtech.com>.
+
 2008-09-11  Yoann Vandoorselaere  <yoann.v@prelude-ids.com>
 
        * lib/glthread/cond.h: Use dummy implementation also if
index 152a32e..1748453 100644 (file)
@@ -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 ()
 {
   {