public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Doug Gregor" <doug.gregor@gmail.com>
To: jklowden@freetds.org
Cc: gcc@gnu.org
Subject: Re: -Wparentheses lumps too much together
Date: Wed, 19 Dec 2007 20:14:00 -0000	[thread overview]
Message-ID: <24b520d20712191211w70c6544fxfc3954a4fffa023@mail.gmail.com> (raw)
In-Reply-To: <20071219200235.GA21525@oak.schemamania.org>

On Dec 19, 2007 3:02 PM,  <jklowden@freetds.org> wrote:
> One last point.  In looking for the rationale behind this warning, I searched
> for examples of it.  I didn't find any discussion on this list.  What I did
> find were many examples of people rototilling perfectly fine code, "improving"
> it by adding unneeded parenthesis specifically so that it would compile
> cleanly with -Wall.  I think that's a shame: a waste of effort at best.
>
> I ask you, please, to consider splitting advice about operator precedence from
> advice about mismatched if/else branches, and to exclude advice about
> making sure && is parenthesized ahead of || from -Wall.  -Wall is the
> standard for "good, clean code" in many projects.  This warning doesn't
> belong there.

For what it is worth, I completely agree with everything you have said
here. This warning oversteps the bounds of what -Wall should do, and
forces people to change perfectly good, clean code. Operator
precedence is an important concept that any C or C++ programmer should
know, and we're not helping anyone by pretending that programmer's
won't understand this concept.

We should certainly remove the warning from -Wall, and perhaps remove
it entirely.

  - Doug

  reply	other threads:[~2007-12-19 20:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-19 20:07 jklowden
2007-12-19 20:14 ` Doug Gregor [this message]
2007-12-19 20:39   ` Ismail Dönmez
2007-12-19 20:15 ` Daniel Jacobowitz
2007-12-19 23:11 ` Ian Lance Taylor
2007-12-20  6:08   ` James K. Lowden
2007-12-20 16:41     ` Paul Brook
2007-12-21 20:19       ` Ross Smith
2008-01-11  7:34         ` Rehno Lindeque
2008-01-11 17:00           ` Joe Buck
2008-01-11 17:05             ` Robert Dewar
2008-01-11 23:26             ` Ian Lance Taylor
2008-01-12  0:50               ` Joe Buck
2007-12-20 18:01     ` Ian Lance Taylor
2007-12-21  5:28       ` James K. Lowden
2007-12-21  9:27 ` Ralf Wildenhues
2007-12-21 17:16   ` NightStrike
2008-01-11 22:44 ` Doug Gregor
2008-01-12  3:48   ` Ian Lance Taylor
2008-01-12 10:16     ` Andreas Schwab
2008-01-12 11:23       ` Paolo Bonzini
2008-01-13 16:03     ` Gabriel Dos Reis
2008-03-10 17:25 Derek M Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24b520d20712191211w70c6544fxfc3954a4fffa023@mail.gmail.com \
    --to=doug.gregor@gmail.com \
    --cc=gcc@gnu.org \
    --cc=jklowden@freetds.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).