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 b9461d7e3f2fb4a0fdf77294d504ae869ac8eb32..ff4bf3c486bca73dca69a5b04961d4199c11d53a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+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.
index 9b6ec87b465f692c0d6af2e3f9016800484a5fc5..6ae17784d193c6544a864ab501d18fcdefe788c9 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);