From: Nick Clifton Date: Mon, 21 Dec 2015 08:23:35 +0000 (+0000) Subject: re PR other/66827 (left shifts of negative value warnings due to C++14 switch) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f8e663301f8b51d033b87d974b04fa431a18227a;p=gcc.git re PR other/66827 (left shifts of negative value warnings due to C++14 switch) PR 66827 * regex.c (EXTRACT_NUMBER): Cast sign byte to unsigned before left shifting. From-SVN: r231873 --- diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 673123c8e05..0bda40e0682 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +2015-12-21 Nick Clifton + + PR 66827 + * regex.c (EXTRACT_NUMBER): Cast sign byte to unsigned before left + shifting. + 2015-11-27 Pedro Alves PR other/61321 diff --git a/libiberty/regex.c b/libiberty/regex.c index 16338cb206b..9ffc3f47f00 100644 --- a/libiberty/regex.c +++ b/libiberty/regex.c @@ -685,7 +685,7 @@ typedef enum # define EXTRACT_NUMBER(destination, source) \ do { \ (destination) = *(source) & 0377; \ - (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \ + (destination) += ((unsigned) SIGN_EXTEND_CHAR (*((source) + 1))) << 8; \ } while (0) # endif