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: "Manuel López-Ibáñez" <lopezibanez at gmail dot com>
- To: "Dirk Mueller" <dmueller at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org, "Gabriel Dos Reis" <gdr at cs dot tamu dot edu>
- Date: Sat, 3 Mar 2007 19:01:30 +0000
- 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>
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.
Also, I am planning to submit a patch to add Walways-true again soon
to warn about comparisons that are always true or false due to limited
range of data types. Just to let it known.
Cheers,
Manuel.