From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27785 invoked by alias); 19 Dec 2007 20:11:40 -0000 Received: (qmail 27769 invoked by uid 22791); 19 Dec 2007 20:11:39 -0000 X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 19 Dec 2007 20:11:29 +0000 Received: from mx10.gnu.org ([199.232.76.166]) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J55GJ-0001Du-7B for gcc@gnu.org; Wed, 19 Dec 2007 15:11:27 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1J55GH-0007xD-Ar for gcc@gnu.org; Wed, 19 Dec 2007 15:11:27 -0500 Received: from fg-out-1718.google.com ([72.14.220.153]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J55GG-0007wr-Vy for gcc@gnu.org; Wed, 19 Dec 2007 15:11:25 -0500 Received: by fg-out-1718.google.com with SMTP id d23so498003fga.30 for ; Wed, 19 Dec 2007 12:11:22 -0800 (PST) Received: by 10.86.4.2 with SMTP id 2mr9235977fgd.77.1198095082395; Wed, 19 Dec 2007 12:11:22 -0800 (PST) Received: by 10.86.79.2 with HTTP; Wed, 19 Dec 2007 12:11:22 -0800 (PST) Message-ID: <24b520d20712191211w70c6544fxfc3954a4fffa023@mail.gmail.com> Date: Wed, 19 Dec 2007 20:14:00 -0000 From: "Doug Gregor" To: jklowden@freetds.org Subject: Re: -Wparentheses lumps too much together Cc: gcc@gnu.org In-Reply-To: <20071219200235.GA21525@oak.schemamania.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071219200235.GA21525@oak.schemamania.org> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg00594.txt.bz2 On Dec 19, 2007 3:02 PM, 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