]> Savannah Git Hosting - gnulib.git/commit
intprops: fix INT_MULTIPLY_WRAPV bit-field bug
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 23 Aug 2020 20:14:13 +0000 (13:14 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 23 Aug 2020 20:15:35 +0000 (13:15 -0700)
commit5d4cdc813c6751a833047ece3dbcf38d976270a6
treea85d70e99e2a880ed15e3dff31207541682d1b4f
parentfd47c1834c2bcb8772f7a320ab088d802b1ca649
intprops: fix INT_MULTIPLY_WRAPV bit-field bug

The bug occurs when using INT_MULTIPLY_WRAPV (a, b, c) where B
is a bit-field, on older GCC or non-GCC compilers where we do
things ourselves instead of using __builtin_mul_overflow.
Without this fix, INT_MULTIPLY_WRAPV would not compile, due
to applying sizeof to a bit-field.
* lib/intprops.h (_GL_INT_MULTIPLY_RANGE_OVERFLOW):
Promote B before giving it to TYPE_WIDTH, in case B is a bit-field.
ChangeLog
lib/intprops.h