1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

Update from gnulib

This incorporates:
2016-08-30 intprops: tune INT_NEGATE_OVERFLOW for GCC 5 and 6
2016-08-29 xalloc-oversized.h: port change to GCC 6.2.0
2016-08-29 intprops.h: port recent changes to GCC 6.2.0
2016-08-29 intprops.h: use __typeof__ with GCC 7
2016-08-29 intprops.h, xalloc-oversized.h: work with gcc 7
2016-08-24 intprops: fix paren typo on old platforms
2016-08-24 intprops: port to OpenVMS
* lib/intprops.h, lib/xalloc-oversized.h: Copy from gnulib.
This commit is contained in:
Paul Eggert 2016-08-30 13:15:04 -07:00
parent 1145322a11
commit 6cf3ee3d54
2 changed files with 29 additions and 26 deletions

View file

@ -43,16 +43,8 @@
nonnegative. This is a macro, not a function, so that it
works correctly even when SIZE_MAX < N. */
/* GCC 7 __builtin_mul_overflow should easily compute this. See:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68120 */
#if 7 <= __GNUC__
# define xalloc_oversized(n, s) __builtin_mul_overflow (n, s, (size_t *) NULL)
/* GCC 5 and Clang __builtin_mul_overflow needs a temporary, and
should be used only for non-constant operands, so that
xalloc_oversized is a constant expression if both arguments are.
Do not use this if pedantic, since pedantic GCC issues a diagnostic
for ({ ... }). */
#if 7 <= __GNUC__ || __has_builtin (__builtin_add_overflow_p)
# define xalloc_oversized(n, s) __builtin_mul_overflow_p (n, s, (size_t) 1)
#elif ((5 <= __GNUC__ \
|| (__has_builtin (__builtin_mul_overflow) \
&& __has_builtin (__builtin_constant_p))) \