[flag-types.h] don't assume 32-bit ints
diff mbox

Message ID 201410152216.s9FMGjq3012196@greed.delorie.com
State New
Headers show

Commit Message

DJ Delorie Oct. 15, 2014, 10:16 p.m. UTC
Since flag-types.h is used in target code, it needs to be -Wall-safe
for targets with 16-bit "int".  OK?

Comments

Jakub Jelinek Oct. 16, 2014, 6:56 a.m. UTC | #1
On Wed, Oct 15, 2014 at 06:16:45PM -0400, DJ Delorie wrote:
> 
> Since flag-types.h is used in target code, it needs to be -Wall-safe
> for targets with 16-bit "int".  OK?

With a ChangeLog entry yes.

> --- gcc/flag-types.h	(revision 216287)
> +++ gcc/flag-types.h	(working copy)
> @@ -229,17 +229,17 @@ enum sanitize_code {
>    SANITIZE_RETURN = 1 << 10,
>    SANITIZE_SI_OVERFLOW = 1 << 11,
>    SANITIZE_BOOL = 1 << 12,
>    SANITIZE_ENUM = 1 << 13,
>    SANITIZE_FLOAT_DIVIDE = 1 << 14,
>    SANITIZE_FLOAT_CAST = 1 << 15,
> -  SANITIZE_BOUNDS = 1 << 16,
> -  SANITIZE_ALIGNMENT = 1 << 17,
> -  SANITIZE_NONNULL_ATTRIBUTE = 1 << 18,
> -  SANITIZE_RETURNS_NONNULL_ATTRIBUTE = 1 << 19,
> -  SANITIZE_OBJECT_SIZE = 1 << 20,
> +  SANITIZE_BOUNDS = 1UL << 16,
> +  SANITIZE_ALIGNMENT = 1UL << 17,
> +  SANITIZE_NONNULL_ATTRIBUTE = 1UL << 18,
> +  SANITIZE_RETURNS_NONNULL_ATTRIBUTE = 1UL << 19,
> +  SANITIZE_OBJECT_SIZE = 1UL << 20,
>    SANITIZE_UNDEFINED = SANITIZE_SHIFT | SANITIZE_DIVIDE | SANITIZE_UNREACHABLE
>  		       | SANITIZE_VLA | SANITIZE_NULL | SANITIZE_RETURN
>  		       | SANITIZE_SI_OVERFLOW | SANITIZE_BOOL | SANITIZE_ENUM
>  		       | SANITIZE_BOUNDS | SANITIZE_ALIGNMENT
>  		       | SANITIZE_NONNULL_ATTRIBUTE
>  		       | SANITIZE_RETURNS_NONNULL_ATTRIBUTE

	Jakub
DJ Delorie Oct. 16, 2014, 8:58 p.m. UTC | #2
> With a ChangeLog entry yes.

Thanks!  Committed.

Patch
diff mbox

Index: gcc/flag-types.h
===================================================================
--- gcc/flag-types.h	(revision 216287)
+++ gcc/flag-types.h	(working copy)
@@ -229,17 +229,17 @@  enum sanitize_code {
   SANITIZE_RETURN = 1 << 10,
   SANITIZE_SI_OVERFLOW = 1 << 11,
   SANITIZE_BOOL = 1 << 12,
   SANITIZE_ENUM = 1 << 13,
   SANITIZE_FLOAT_DIVIDE = 1 << 14,
   SANITIZE_FLOAT_CAST = 1 << 15,
-  SANITIZE_BOUNDS = 1 << 16,
-  SANITIZE_ALIGNMENT = 1 << 17,
-  SANITIZE_NONNULL_ATTRIBUTE = 1 << 18,
-  SANITIZE_RETURNS_NONNULL_ATTRIBUTE = 1 << 19,
-  SANITIZE_OBJECT_SIZE = 1 << 20,
+  SANITIZE_BOUNDS = 1UL << 16,
+  SANITIZE_ALIGNMENT = 1UL << 17,
+  SANITIZE_NONNULL_ATTRIBUTE = 1UL << 18,
+  SANITIZE_RETURNS_NONNULL_ATTRIBUTE = 1UL << 19,
+  SANITIZE_OBJECT_SIZE = 1UL << 20,
   SANITIZE_UNDEFINED = SANITIZE_SHIFT | SANITIZE_DIVIDE | SANITIZE_UNREACHABLE
 		       | SANITIZE_VLA | SANITIZE_NULL | SANITIZE_RETURN
 		       | SANITIZE_SI_OVERFLOW | SANITIZE_BOOL | SANITIZE_ENUM
 		       | SANITIZE_BOUNDS | SANITIZE_ALIGNMENT
 		       | SANITIZE_NONNULL_ATTRIBUTE
 		       | SANITIZE_RETURNS_NONNULL_ATTRIBUTE