summaryrefslogtreecommitdiff
path: root/lib/intprops.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-08-14 18:05:57 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-08-14 18:06:17 -0700
commit96b8849e0203df4bd08610b6d58b3cfa7a2c72b5 (patch)
tree44028a022b41d97494c97c6f52548879b95104a1 /lib/intprops.h
parent8a7ac1d24ac54ca8f076320a61548c343040357b (diff)
downloadgnulib-96b8849e0203df4bd08610b6d58b3cfa7a2c72b5.tar.gz
intprops: pacify picky GCC
* lib/intprops.h (_GL_BUILTIN_MUL_OVERFLOW): Pacify GCC’s complaints about ignoring __builtin_mul_overflow’s possibly-incorrect result. (_GL_INT_MULTIPLY_RANGE_OVERFLOW): Pacify GCC’s complaints about (A) used as a boolean, when A is an expression like 3 * 4.
Diffstat (limited to 'lib/intprops.h')
-rw-r--r--lib/intprops.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/intprops.h b/lib/intprops.h
index 556cadec80..54012874df 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -366,7 +366,7 @@
#define _GL_BUILTIN_MUL_OVERFLOW(a, b, r) \
((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && EXPR_SIGNED (a) && EXPR_SIGNED (b) \
&& _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \
- ? (__builtin_mul_overflow (a, b, r), 1) \
+ ? ((void) __builtin_mul_overflow (a, b, r), 1) \
: __builtin_mul_overflow (a, b, r))
/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See:
@@ -540,7 +540,9 @@
: (tmax) / -(b)) \
<= -1 - (a))) \
: INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (b, tmin)) && (b) == -1 \
- ? (EXPR_SIGNED (a) ? 0 < (a) + (tmin) : (a) && -1 - (tmin) < (a) - 1) \
+ ? (EXPR_SIGNED (a) \
+ ? 0 < (a) + (tmin) \
+ : 0 < (a) && -1 - (tmin) < (a) - 1) \
: (tmin) / (b) < (a)) \
: (b) == 0 \
? 0 \