From db0558c11347ad27a032e6efed509a6e99b52e67 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 12 Jan 2006 19:23:22 +0000 Subject: =?UTF-8?q?Use=20a=20more=20bulletproof=20test=20for=20whether=20f?= =?UTF-8?q?inite()=20and=20isinf()=20are=20present.=20It=20seems=20that=20?= =?UTF-8?q?recent=20gcc=20versions=20can=20optimize=20away=20calls=20to=20?= =?UTF-8?q?these=20functions=20even=20when=20the=20functions=20do=20not=20?= =?UTF-8?q?exist=20on=20the=20platform,=20resulting=20in=20a=20bogus=20pos?= =?UTF-8?q?itive=20result.=20=20Avoid=20this=20by=20using=20a=20non-consta?= =?UTF-8?q?nt=20argument=20and=20ensuring=20that=20the=20function=20result?= =?UTF-8?q?=20is=20not=20simply=20discarded.=20=20Per=20report=20from=20Fr?= =?UTF-8?q?an=C3=A7ois=20Laupretre.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configure | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'configure') diff --git a/configure b/configure index acb4592d8d..0a676a3fd2 100755 --- a/configure +++ b/configure @@ -14202,7 +14202,6 @@ fi -# do this one the hard way in case isinf() is a macro echo "$as_me:$LINENO: checking for isinf" >&5 echo $ECHO_N "checking for isinf... $ECHO_C" >&6 if test "${ac_cv_func_isinf+set}" = set; then @@ -14214,12 +14213,14 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ + #include +double glob_double; int main () { -double x = 0.0; int res = isinf(x); +return isinf(glob_double) ? 0 : 1; ; return 0; } @@ -15102,11 +15103,14 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ + #include +double glob_double; + int main () { -int dummy=finite(1.0); +return finite(glob_double) ? 0 : 1; ; return 0; } -- cgit v1.2.1