public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Enable -Wlogical-not-parentheses by -Wall
@ 2014-09-02 15:53 Marek Polacek
  2014-09-03 18:53 ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Polacek @ 2014-09-02 15:53 UTC (permalink / raw)
  To: GCC Patches

Now that PR61271 and PR62270 have been fixed, we can enable
-Wlogical-not-parentheses by -Wall.  I think this warning proved
useful.

Bootstrapped/regtested on x86_64-linux and ppc64-linux, ok for trunk?

2014-08-26  Marek Polacek  <polacek@redhat.com>

	* doc/invoke.texi: Document that -Wlogical-not-parentheses is enabled
	by -Wall.
c-family/
	* c.opt (Wlogical-not-parentheses): Enable by -Wall.

diff --git gcc/c-family/c.opt gcc/c-family/c.opt
index 210a099..643f256 100644
--- gcc/c-family/c.opt
+++ gcc/c-family/c.opt
@@ -519,7 +519,7 @@ C ObjC C++ ObjC++ Var(warn_logical_op) Init(0) Warning
 Warn when a logical operator is suspiciously always evaluating to true or false
 
 Wlogical-not-parentheses
-C ObjC C++ ObjC++ Var(warn_logical_not_paren) Warning
+C ObjC C++ ObjC++ Var(warn_logical_not_paren) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
 Warn when logical not is used on the left hand side operand of a comparison
 
 Wlong-long
diff --git gcc/doc/invoke.texi gcc/doc/invoke.texi
index d15d4a9..9864708 100644
--- gcc/doc/invoke.texi
+++ gcc/doc/invoke.texi
@@ -4800,6 +4800,8 @@ parentheses:
 if ((!a) > 1) @{ @dots{} @}
 @end smallexample
 
+This warning is enabled by @option{-Wall}.
+
 @item -Waggregate-return
 @opindex Waggregate-return
 @opindex Wno-aggregate-return

	Marek

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-03 19:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-02 15:53 [PATCH] Enable -Wlogical-not-parentheses by -Wall Marek Polacek
2014-09-03 18:53 ` Jeff Law
2014-09-03 19:40   ` Marek Polacek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).