This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PING: [PATCH] Implement warning for wrong use of ||/&&
- From: Gabriel Dos Reis <gdr at cs dot tamu dot edu>
- To: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- Cc: Dirk Mueller <dmueller at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Sat, 3 Mar 2007 19:20:21 -0600 (CST)
- Subject: Re: PING: [PATCH] Implement warning for wrong use of ||/&&
- References: <200702130009.06245.dmueller@suse.de> <200702191518.55121.dmueller@suse.de> <87ejom41ru.fsf@soliton.cs.tamu.edu> <200702220027.08671.dmueller@suse.de> <6c33472e0703031101te0cf9cdq9b729cf83d39da46@mail.gmail.com>
On Sat, 3 Mar 2007, Manuel López-Ibáñez wrote:
| On 21/02/07, Dirk Mueller <dmueller@suse.de> wrote:
| > On Monday, 19. February 2007 16:15, Gabriel Dos Reis wrote:
| >
| > > Please factor the hunks in c-typeck (parser_build_binary_op) and
| > > cp/call.c (build_new_op) into
| > > a separate function. maybe_warn_for_suspicious_logical_operator?
| > >
| > > Patch OK with those changes.
| >
| > Given that -Walways-true is gone now, I've decided for -Winvariant-expr.
| >
| > Patch has been bootstrapped, regtested on i686-suse-linux. Any feelings about
| > the name of the warning?
| >
|
| I would prefer a greener bikeshed such as Wlogical but, if I am alone, so be it.
|
| I think the option should be enabled by Wextra at least. and perhaps
| (in the future) include PR16302. PR7543 might be also a good candidate
| for this or for Wparentheses.
The option should NOT be on by default. I don't think
-Winvariant-expr is suggestive enough. Maybe -Wlogical-op?
Thanks for your patience,
-- Gaby