From owner-cvs-all@FreeBSD.ORG Mon Mar 29 23:59:50 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A640F16A4CE for ; Mon, 29 Mar 2004 23:59:50 -0800 (PST) Received: from root.org (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 7BBB243D49 for ; Mon, 29 Mar 2004 23:59:50 -0800 (PST) (envelope-from nate@root.org) Received: (qmail 78632 invoked by uid 1000); 30 Mar 2004 07:59:52 -0000 Date: Mon, 29 Mar 2004 23:59:52 -0800 (PST) From: Nate Lawson To: Julian Elischer In-Reply-To: Message-ID: <20040329235454.F78512@root.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.ORG cc: David Schultz cc: src-committers@FreeBSD.ORG cc: cvs-all@FreeBSD.ORG cc: David O'Brien Subject: Re: cvs commit: src/sys/kern subr_bus.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2004 07:59:50 -0000 On Wed, 24 Mar 2004, Julian Elischer wrote: > On Wed, 24 Mar 2004, David Schultz wrote: > > > On Mon, Mar 22, 2004, David O'Brien wrote: > > > On Mon, Mar 22, 2004 at 06:06:48PM -0800, Nate Lawson wrote: > > > > > + if (bootverbose && flags & INTR_MPSAFE) > > > .. > > > > I recommend you parenthesize (flags & INTR_MPSAFE). > > > > > > man operator :-) > > > > For some reason, gcc complains about the lack of excessive > > parentheses for expressions like 'a && b || c' and > > 'foo >> shift1 + shift2', but not for 'a && b & c'. > > It's too bad there's no documentation on which parts of > > operator(7) are supposed to be considered obvious (along > > with a note that =='s priority over & is a mistake---that > > one often bites me.) > > > > I agree. it is often late at night when staring at code looking for a > bug that one fails to notice the subtlties of operator precedence. > > One person's "obvious" is not always obvious to others. Especially if > one has noticed differences in precedence between different languages > one has worked with in one's life. > > a couple of extra parens on a statement with 'non-normal' form > such as that above can save hours later. I agree with one exception -- when parens are used in an overly obvious way (like MDAS) or in an attempt to force precedence (which they cannot do.) Parens only indicate associativity, they cannot override precedence. -Nate