summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-07-05 16:11:48 -0400
committerNick Mathewson <nickm@torproject.org>2017-07-05 16:11:48 -0400
commit0dc7d68bb57309df11a70c63562d25dd2d1c63ad (patch)
treec01d13a71cc65f956ab7db38a96374b59e86c2f5
parenta85ee62e74905af0c685d378be9dfc8ae1935af5 (diff)
parent15b13578e89e79d1f2199e05e0b4faba2b64bf9d (diff)
downloadtor-0dc7d68bb57309df11a70c63562d25dd2d1c63ad.tar.gz
tor-0dc7d68bb57309df11a70c63562d25dd2d1c63ad.zip
Merge branch 'maint-0.3.1'
-rw-r--r--src/common/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 07502e2e6c..f53a99533b 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -5598,13 +5598,14 @@ clamp_double_to_int64(double number)
{
int exponent;
-#if defined(__MINGW32__) || defined(__MINGW64__)
+#if (defined(__MINGW32__) || defined(__MINGW64__)) && GCC_VERSION >= 409
/*
Mingw's math.h uses gcc's __builtin_choose_expr() facility to declare
isnan, isfinite, and signbit. But as implemented in at least some
versions of gcc, __builtin_choose_expr() can generate type warnings
even from branches that are not taken. So, suppress those warnings.
*/
+#define PROBLEMATIC_FLOAT_CONVERSION_WARNING
DISABLE_GCC_WARNING(float-conversion)
#endif
/* NaN is a special case that can't be used with the logic below. */
@@ -5632,7 +5633,7 @@ DISABLE_GCC_WARNING(float-conversion)
/* Handle infinities and finite numbers with magnitude >= 2^63. */
return signbit(number) ? INT64_MIN : INT64_MAX;
-#if defined(__MINGW32__) || defined(__MINGW64__)
+#ifdef PROBLEMATIC_FLOAT_CONVERSION_WARNING
ENABLE_GCC_WARNING(float-conversion)
#endif
}