From: Paul Eggert Date: Sun, 23 Aug 2020 20:14:14 +0000 (-0700) Subject: intprops: be consistent about +X vs X+0 X-Git-Tag: v1.0~3683 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=01405116164d46c58497fb3cf0fb8aae3955cf86;p=gnulib.git intprops: be consistent about +X vs X+0 * lib/intprops.h (_GL_SIGNED_INT_MAXIMUM): Simplify. --- diff --git a/ChangeLog b/ChangeLog index a6caef9b04..e51ea41e39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2020-08-23 Paul Eggert + intprops: be consistent about +X vs X+0 + * lib/intprops.h (_GL_SIGNED_INT_MAXIMUM): Simplify. + 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 diff --git a/lib/intprops.h b/lib/intprops.h index 1bd93d11f9..df66a3877a 100644 --- a/lib/intprops.h +++ b/lib/intprops.h @@ -70,7 +70,7 @@ ? _GL_SIGNED_INT_MAXIMUM (e) \ : _GL_INT_NEGATE_CONVERT (e, 1)) #define _GL_SIGNED_INT_MAXIMUM(e) \ - (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1) + (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1) /* Work around OpenVMS incompatibility with C99. */ #if !defined LLONG_MAX && defined __INT64_MAX