]> Savannah Git Hosting - gnulib.git/commit
intprops.h, verify.h: port better to clang
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 26 Aug 2019 02:29:15 +0000 (19:29 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 26 Aug 2019 02:30:00 +0000 (19:30 -0700)
commit4c352322c5f62a22a8a238071bde26c9f482fea2
tree3f81e7f5fc3a0f8ec95db6bf1aa32b241a1a7a79
parent77daeef875821f8a00bafc752a5cfc95f3e11e40
intprops.h, verify.h: port better to clang

Improve code generated by INT_ADD_WRAPV and INT_SUBTRACT_WRAPV
with Clang.  Problem reported privately by Mattias Engdegård.
Also, insulate intprops.h and verify.h better against each other’s
definitions of __has_builtin on non-Clang hosts.
* lib/intprops.h (__has_builtin): Define a temporary substitute
if __has_builtin is not already defined.
(_GL_HAS___builtin_add_overflow, _GL_TEMPDEF___has_builtin):
New temporary internal macros.
(_GL_HAS_BUILTIN_ADD_OVERFLOW, _GL_HAS_BUILTIN_MUL_OVERFLOW):
Now two separate macros, replacing the old
_GL_HAS_BUILTIN_OVERFLOW, since we no longer assume that
__builtin_mul_overflow is like the rest.  All uses changed.
(INT_ADD_WRAPV, INT_SUBTRACT_WRAPV, INT_MULTIPLY_WRAPV):
Adjust to above changes.
(_GL_INT_OP_WRAPV): Remove ‘builtin’ arg, since it’s no
longer relevant.  All uses changed.
* lib/verify.h (__has_builtin): Treat like intprops.h,
so that the two .h files do not collide with each other.
(_GL_HAS___builtin_unreachable, _GL_HAS___builtin_trap)
(_GL_TEMPDEF___has_builtin): New temporary internal macros.
ChangeLog
lib/intprops.h
lib/verify.h