diff options
author | Alexey Kopytov <Alexey.Kopytov@sun.com> | 2009-03-24 11:26:22 +0300 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@sun.com> | 2009-03-24 11:26:22 +0300 |
commit | bbe24f03f2288049b39359ad52b0cccc1b762b44 (patch) | |
tree | 12d22303b90070d975a188c65c473b869ba8b14b /configure.in | |
parent | 4568152518d075ec543bcc55b77241e4a5bf7c17 (diff) | |
download | mariadb-git-bbe24f03f2288049b39359ad52b0cccc1b762b44.tar.gz |
Fix for bug #42965: isinf() on 32bit x86 with gcc 4.3 can
produce incorrect results for ROUND()
Added a workaround and a configure check to test whether
isinf() is affected by the GCC bug #39228.
Since no code in MySQL server is currently affected by that
bug, the patch is actually a safeguard for possible future
code modifications. No test cases or changelog entries are
needed.
configure.in:
Added a configure check to test whether isinf() is safe to use
in C code.
include/my_global.h:
Added a workaround for GCC bug #39228.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 9591b5bbc5a..afe0cdc78ed 100644 --- a/configure.in +++ b/configure.in @@ -2094,6 +2094,27 @@ esac AC_MSG_CHECKING(for isinf in <math.h>) AC_TRY_LINK([#include <math.h>], [float f = 0.0; int r = isinf(f); return r], AC_MSG_RESULT(yes) + AC_MSG_CHECKING(whether isinf() is safe to use in C code) + AC_TRY_RUN([ +#include <math.h> +int main() +{ + double a= 10.0; + double b= 1e308; + + return !isinf(a * b); +} +], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + AC_DEFINE([HAVE_BROKEN_ISINF], [1], + [Define to 1 if isinf() uses 80-bit register for intermediate values]) + ], + [ +# Let's be optimistic when cross-compiling, since the only compiler known +# to be affected by this isinf() bug is GCC 4.3 on 32-bit x86. + AC_MSG_RESULT([[cross-compiling, assuming 'yes']]) + ]) AC_MSG_CHECKING(whether isinf() can be used in C++ code) AC_LANG_SAVE AC_LANG_CPLUSPLUS |