summaryrefslogtreecommitdiff
path: root/lib/isnan.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-03-25 19:45:26 +0000
committerBruno Haible <bruno@clisp.org>2007-03-25 19:45:26 +0000
commitd2c57e54a1f805be7c7859f12962a3804a4a635d (patch)
tree1b5f0cc54860c875663d1dd9450cc717966e2ec3 /lib/isnan.c
parente3078b005a9292e171b2ffd37ba6a80c1df2ba2e (diff)
downloadgnulib-d2c57e54a1f805be7c7859f12962a3804a4a635d.tar.gz
Work around DEC C 6.4 compiler bug.
Diffstat (limited to 'lib/isnan.c')
-rw-r--r--lib/isnan.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/isnan.c b/lib/isnan.c
index 9b6ec87b46..6ae17784d1 100644
--- a/lib/isnan.c
+++ b/lib/isnan.c
@@ -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);