>From 01405116164d46c58497fb3cf0fb8aae3955cf86 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 23 Aug 2020 13:14:14 -0700 Subject: [PATCH 2/2] intprops: be consistent about +X vs X+0 * lib/intprops.h (_GL_SIGNED_INT_MAXIMUM): Simplify. --- ChangeLog | 3 +++ lib/intprops.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a6caef9b0..e51ea41e3 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 1bd93d11f..df66a3877 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 -- 2.17.1