Mercurial > gnulib
changeset 28233:fa7ef4813cc2
Work around DEC C 6.4 compiler bug.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 25 Mar 2007 19:45:26 +0000 |
parents | ebbc9119f96d |
children | 5aba35255285 |
files | ChangeLog lib/isnan.c |
diffstat | 2 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sun Mar 25 19:36:17 2007 +0000 +++ b/ChangeLog Sun Mar 25 19:45:26 2007 +0000 @@ -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.
--- a/lib/isnan.c Sun Mar 25 19:36:17 2007 +0000 +++ b/lib/isnan.c Sun Mar 25 19:45:26 2007 +0000 @@ -64,11 +64,14 @@ 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);