Work around DEC C 6.4 compiler bug.
authorBruno Haible <bruno@clisp.org>
Sun, 25 Mar 2007 19:45:26 +0000 (19:45 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 25 Mar 2007 19:45:26 +0000 (19:45 +0000)
ChangeLog
lib/isnan.c

index b9461d7..ff4bf3c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2007-03-25  Bruno Haible  <bruno@clisp.org>
 
+       * lib/isnan.c (FUNC): Work around a DEC C compiler bug.
+
+2007-03-25  Bruno Haible  <bruno@clisp.org>
+
        * lib/glob_.h: Include <sys/stat.h>. Avoids warnings on AIX 5.1.
 
 2007-03-25  Bruno Haible  <bruno@clisp.org>
index 9b6ec87..6ae1778 100644 (file)
@@ -64,11 +64,14 @@ FUNC (DOUBLE x)
      because x may be a signaling NaN.  */
 # if defined __SUNPRO_C || defined __DECC
   /* The Sun C 5.0 compilers and the Compaq (ex-DEC) 6.4 compilers don't
-     recognize the initializers as constant expressions.  */
+     recognize the initializers as constant expressions.  The latter compiler
+     also fails when constant-folding 0.0 / 0.0 even when constant-folding is
+     not required.  */
+  static DOUBLE zero = L_(0.0);
   memory_double nan;
   DOUBLE plus_inf = L_(1.0) / L_(0.0);
   DOUBLE minus_inf = -L_(1.0) / L_(0.0);
-  nan.value = L_(0.0) / L_(0.0);
+  nan.value = zero / zero;
 # else
   static memory_double nan = { L_(0.0) / L_(0.0) };
   static DOUBLE plus_inf = L_(1.0) / L_(0.0);