aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-01-12 19:23:41 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-01-12 19:23:41 +0000
commite2c60a2cfe3b8f12564133d18d62d6dece12c63f (patch)
tree593754cdaf2e84b2b895dc08bbba3dc659f68702 /configure
parent34b0ac6ada5e7e9ea99a4059a5ed5d5f34142147 (diff)
downloadpostgresql-e2c60a2cfe3b8f12564133d18d62d6dece12c63f.tar.gz
postgresql-e2c60a2cfe3b8f12564133d18d62d6dece12c63f.zip
Use a more bulletproof test for whether finite() and isinf() are present.
It seems that recent gcc versions can optimize away calls to these functions even when the functions do not exist on the platform, resulting in a bogus positive result. Avoid this by using a non-constant argument and ensuring that the function result is not simply discarded. Per report from François Laupretre.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure10
1 files changed, 7 insertions, 3 deletions
diff --git a/configure b/configure
index 60270b638d2..52a1605cffe 100755
--- a/configure
+++ b/configure
@@ -14241,7 +14241,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
@@ -14253,12 +14252,14 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+
#include <math.h>
+double glob_double;
int
main ()
{
-double x = 0.0; int res = isinf(x);
+return isinf(glob_double) ? 0 : 1;
;
return 0;
}
@@ -15138,11 +15139,14 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+
#include <math.h>
+double glob_double;
+
int
main ()
{
-int dummy=finite(1.0);
+return finite(glob_double) ? 0 : 1;
;
return 0;
}