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 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


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