OSDN Git Service

2009-05-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 May 2009 19:29:27 +0000 (19:29 +0000)
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 May 2009 19:29:27 +0000 (19:29 +0000)
PR c/40172
gcc/
* c.opt (Wlogical-op): Disabled by default.
* c-opt (c_common_post_options): Do not enable Wlogical-op with
Wextra.
* doc/invoke.texi (Wlogical-op): Likewise.
testsuite/
* gcc.dg/pr40172.c: Add -Wlogical-op to dg-options.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147717 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-opts.c
gcc/c.opt
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr40172.c

index 569f646..19574c3 100644 (file)
@@ -1,3 +1,11 @@
+2009-05-19  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       PR c/40172
+       * c.opt (Wlogical-op): Disabled by default.
+       * c-opt (c_common_post_options): Do not enable Wlogical-op with
+       Wextra.
+       * doc/invoke.texi (Wlogical-op): Likewise.
+       
 2009-05-19  Eric Botcazou  <ebotcazou@adacore.com>
 
        * tree-scalar-evolution.c (follow_ssa_edge_expr) <NOP_EXPR>: Turn
index 967be52..df6fdad 100644 (file)
@@ -1073,8 +1073,6 @@ c_common_post_options (const char **pfilename)
     warn_override_init = extra_warnings;
   if (warn_ignored_qualifiers == -1)
     warn_ignored_qualifiers = extra_warnings;
-  if (warn_logical_op == -1)
-    warn_logical_op = extra_warnings;
 
   /* -Wpointer-sign is disabled by default, but it is enabled if any
      of -Wall or -pedantic are given.  */
index fc34ff5..da1de00 100644 (file)
--- a/gcc/c.opt
+++ b/gcc/c.opt
@@ -285,7 +285,7 @@ C ObjC C++ ObjC++ Warning
 Warn about PCH files that are found but not used
 
 Wlogical-op
-C ObjC C++ ObjC++ Var(warn_logical_op) Init(-1) Warning 
+C ObjC C++ ObjC++ Var(warn_logical_op) Init(0) Warning 
 Warn when a logical operator is suspiciously always evaluating to true or false
 
 Wlong-long
index cb2249e..3dba074 100644 (file)
@@ -2806,7 +2806,6 @@ name is still supported, but the newer name is more descriptive.)
 @gccoptlist{-Wclobbered  @gol
 -Wempty-body  @gol
 -Wignored-qualifiers @gol
--Wlogical-op @gol
 -Wmissing-field-initializers  @gol
 -Wmissing-parameter-type @r{(C only)}  @gol
 -Wold-style-declaration @r{(C only)}  @gol
@@ -3793,8 +3792,7 @@ programmer intended to use @code{strcmp}.  This warning is enabled by
 @opindex Wno-logical-op
 Warn about suspicious uses of logical operators in expressions.
 This includes using logical operators in contexts where a
-bit-wise operator is likely to be expected.  This warning is enabled by
-@option{-Wextra}.
+bit-wise operator is likely to be expected.
 
 @item -Waggregate-return
 @opindex Waggregate-return
index 3457351..dab10df 100644 (file)
@@ -1,3 +1,8 @@
+2009-05-19  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       PR c/40172
+       * gcc.dg/pr40172.c: Add -Wlogical-op to dg-options.
+       
 2009-05-19  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/loop_optimization6.ad[sb]: New test.
index aff3476..a834a8a 100644 (file)
@@ -1,6 +1,6 @@
 /* PR middle-end/40172 */
 /* { dg-do compile } */
-/* { dg-options "-Wall -W -Werror" } */
+/* { dg-options "-Wall -W -Werror -Wlogical-op" } */
 
 struct rtx_def;
 typedef struct rtx_def *rtx;