re PR other/66827 (left shifts of negative value warnings due to C++14 switch)
authorNick Clifton <nickc@redhat.com>
Mon, 21 Dec 2015 08:23:35 +0000 (08:23 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Mon, 21 Dec 2015 08:23:35 +0000 (08:23 +0000)
PR 66827
* regex.c (EXTRACT_NUMBER): Cast sign byte to unsigned before left
shifting.

From-SVN: r231873

libiberty/ChangeLog
libiberty/regex.c

index 673123c8e05589e706f89e60af6947f974fe6158..0bda40e0682e3601d5dab3c98c73f33120c212ca 100644 (file)
@@ -1,3 +1,9 @@
+2015-12-21  Nick Clifton  <nickc@redhat.com>
+
+       PR 66827
+       * regex.c (EXTRACT_NUMBER): Cast sign byte to unsigned before left
+       shifting.
+
 2015-11-27  Pedro Alves  <palves@redhat.com>
 
        PR other/61321
index 16338cb206b455d87d275e778d4590500c213216..9ffc3f47f006d89b7c046b704e7ac6cc0ae78d80 100644 (file)
@@ -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