This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PING: [PATCH] Implement warning for wrong use of ||/&&


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]