From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4478 invoked by alias); 11 Jan 2008 07:34:52 -0000 Received: (qmail 4469 invoked by uid 22791); 11 Jan 2008 07:34:51 -0000 X-Spam-Check-By: sourceware.org Received: from wa-out-1112.google.com (HELO wa-out-1112.google.com) (209.85.146.178) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 11 Jan 2008 07:34:31 +0000 Received: by wa-out-1112.google.com with SMTP id m16so1528341waf.20 for ; Thu, 10 Jan 2008 23:34:29 -0800 (PST) Received: by 10.115.74.1 with SMTP id b1mr3340160wal.93.1200036869684; Thu, 10 Jan 2008 23:34:29 -0800 (PST) Received: by 10.114.13.12 with HTTP; Thu, 10 Jan 2008 23:34:29 -0800 (PST) Message-ID: Date: Fri, 11 Jan 2008 07:34:00 -0000 From: "Rehno Lindeque" To: "Ross Smith" Subject: Re: -Wparentheses lumps too much together Cc: gcc@gcc.gnu.org In-Reply-To: <476C1461.2050107@ihug.co.nz> 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> <20071220005030.4971a442.jklowden@freetds.org> <200712201509.20582.paul@codesourcery.com> <476C1461.2050107@ihug.co.nz> 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: 2008-01/txt/msg00134.txt.bz2 > > Yes, I know beginners get confused by and/or precedence. But > > *every* language that I know of that has operator precedence places > > 'and' before 'or'. > > FWIW, Bourne shell doesn't, && and || have equal precedence there. > That's a bit off-topic though, as it's not an argument against your > actual proposition, but rather one for `sh -Wall'. ;-) > It's not entirely off-topic. Not all programmers are dedicated to a > specific language. It's customary to work on several different > languages, and keeping things like operator precedance straight in > your head between languages is not always easy. Things like -Wall are > a great help in making sure that you don't miss any of those > inter-language oddities. Just a note: Operator precedence is taught as logical AND comes before OR in logic courses. So it is a sort of a standard mathematical convention just like + and *. In fact, OR is even represented as a + in some notations. However it might not be practical to assume all programmers have a background in logic. -Rehno Lindeque