diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-01-06 13:36:57 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-01-06 13:38:05 -0800 |
commit | 04441fd8156978cfc51d6c203fd43c23b64f95df (patch) | |
tree | f6e072a004ba37dd716f97b07ae45161d3c8600f /lib/intprops.h | |
parent | f0f371e137158a86c4bc846a1492cd47f95a0291 (diff) | |
download | gnulib-04441fd8156978cfc51d6c203fd43c23b64f95df.tar.gz |
glob, intprops, xalloc: work around Clang bug
Work around LLVM bug 16404, which is still not fixed.
https://llvm.org/bugs/show_bug.cgi?id=16404
Problem reported by Nelson H. F. Beebe.
* lib/glob.c, lib/intprops.h, lib/xalloc-oversized.h (__has_builtin):
Remove.
* lib/glob.c (size_add_wrapv):
* lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW, _GL_HAS_BUILTIN_OVERFLOW_P):
* lib/xalloc-oversized.h (xalloc_oversized):
Do not use overflow builtins if Clang.
Diffstat (limited to 'lib/intprops.h')
-rw-r--r-- | lib/intprops.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/intprops.h b/lib/intprops.h index 3b0c5d0dfd..eb06b6917e 100644 --- a/lib/intprops.h +++ b/lib/intprops.h @@ -23,10 +23,6 @@ #include <limits.h> #include <verify.h> -#ifndef __has_builtin -# define __has_builtin(x) 0 -#endif - /* Return a value with the common real type of E and V and the value of V. */ #define _GL_INT_CONVERT(e, v) (0 * (e) + (v)) @@ -241,12 +237,10 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH); : (max) >> (b) < (a)) /* True if __builtin_add_overflow (A, B, P) works when P is non-null. */ -#define _GL_HAS_BUILTIN_OVERFLOW \ - (5 <= __GNUC__ || __has_builtin (__builtin_add_overflow)) +#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__) /* True if __builtin_add_overflow_p (A, B, C) works. */ -#define _GL_HAS_BUILTIN_OVERFLOW_P \ - (7 <= __GNUC__ || __has_builtin (__builtin_add_overflow_p)) +#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__) /* The _GL*_OVERFLOW macros have the same restrictions as the *_RANGE_OVERFLOW macros, except that they do not assume that operands |