diff mbox

Make -Wint-in-bool-context warn on suspicious shift ops

Message ID HE1PR0701MB2169E696429EAEFEECCDBB7DE4D50@HE1PR0701MB2169.eurprd07.prod.outlook.com
State New
Headers show

Commit Message

Bernd Edlinger Oct. 20, 2016, 2 p.m. UTC
On 10/20/16 10:05, Markus Trippelsdorf wrote:
>
> Thanks for the commit. But I think the comment is wrong:
>
> +      /* We will only warn on unsigned shifts here, because the majority of
>                                ^^
> This should be »signed«.
>

Oops.  Thanks for noticing.

This is what I am going to check in as obvious:

  	 result of the shift is not subject to integer promotion rules.  */


Bernd
diff mbox

Patch

--- ChangeLog	(revision 241376)
+++ ChangeLog	(working copy)
@@ -1,3 +1,7 @@ 
+2016-10-20  Bernd Edlinger  <bernd.edlinger@hotmail.de>
+
+	* c-common.c (c_common_truthvalue_conversion): Fix the comment.
+
  2016-10-20  Jason Merrill  <jason@redhat.com>

  	* c-cppbuiltin.c (c_cpp_builtins): Update __cpp_concepts value.
Index: c-common.c
===================================================================
--- c-common.c	(revision 241376)
+++ c-common.c	(working copy)
@@ -3328,7 +3328,7 @@ 
  					       TREE_OPERAND (expr, 0));

      case LSHIFT_EXPR:
-      /* We will only warn on unsigned shifts here, because the majority of
+      /* We will only warn on signed shifts here, because the majority of
  	 false positive warnings happen in code where unsigned arithmetic
  	 was used in anticipation of a possible overflow.
  	 Furthermore, if we see an unsigned type here we know that the