diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-07-05 16:11:48 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-07-05 16:11:48 -0400 |
commit | 55777b3ff90311212ac3f38829229fed7b7beffe (patch) | |
tree | ff273a9aea3ce8d477cea9740c19ea1bcb8efd27 /src/common | |
parent | 546f5b364bd8198b23b1ad4e66790eb1ce9b438e (diff) | |
parent | dfc06148407a1610d515d45b344558850486bd98 (diff) | |
download | tor-55777b3ff90311212ac3f38829229fed7b7beffe.tar.gz tor-55777b3ff90311212ac3f38829229fed7b7beffe.zip |
Merge branch 'maint-0.2.9' into maint-0.3.0
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/util.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c index fef30e4a5f..a2c3dc7550 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -5734,13 +5734,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. */ @@ -5768,7 +5769,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 } |