]> git.ipfire.org Git - thirdparty/glibc.git/commit
include: Sync gnulib intprops
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 28 Oct 2025 17:08:10 +0000 (14:08 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 29 Oct 2025 15:53:50 +0000 (12:53 -0300)
commit602fdf5d69e7134e6d25ecef2762bc819ba6b01c
tree65230f6dab1470d4a37719e6c3ddf350c869f6c7
parent5ee722d3ac0da7f7e389af946317272957c7568b
include: Sync gnulib intprops

It syncs with gnulib commit 1790ef25d81983d1d25a77d452c0080345df459b.

The main change is to proper support clang by using builtins.  It
fixes a sprof build issue, where previous version uses the generic
code path when building with clang:

sprof.c:682:8: error: result of comparison of constant 288230376151711743 with expression of type 'Elf64_Half' (aka 'unsigned short') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
  682 |           if (INT_MULTIPLY_WRAPV (ehdr2.e_shnum, sizeof (ElfW(Shdr)), &size))
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/intprops.h:415:34: note: expanded from macro 'INT_MULTIPLY_WRAPV'
  415 |    _GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW)
      |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/intprops.h:504:45: note: expanded from macro '_GL_INT_OP_WRAPV'
  504 |     : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
../include/intprops.h:511:41: note: expanded from macro '_GL_INT_OP_WRAPV_LONGISH'
  511 |         : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  512 |                            unsigned long int, 0, ULONG_MAX)) \
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/intprops.h:533:4: note: expanded from macro '_GL_INT_OP_CALC'
  533 |   (overflow (a, b, tmin, tmax) \
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/intprops.h:608:22: note: expanded from macro '_GL_INT_MULTIPLY_RANGE_OVERFLOW'
  608 |       : (tmax) / (b) < (a)))
      |         ~~~~~~~~~~~~ ^ ~~~
1 error generated.

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
SHARED-FILES
include/intprops-internal.h [new file with mode: 0644]
include/intprops.h