From owner-cvs-src@FreeBSD.ORG Wed Mar 24 01:09:38 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BBCD516A4CE; Wed, 24 Mar 2004 01:09:38 -0800 (PST) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1843343D45; Wed, 24 Mar 2004 01:09:38 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc12) with ESMTP id <200403240909360120087ebqe>; Wed, 24 Mar 2004 09:09:37 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id BAA57581; Wed, 24 Mar 2004 01:12:23 -0800 (PST) Date: Wed, 24 Mar 2004 01:12:21 -0800 (PST) From: Julian Elischer To: David Schultz In-Reply-To: <20040324090036.GA61340@VARK.homeunix.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.ORG cc: src-committers@FreeBSD.ORG cc: cvs-all@FreeBSD.ORG cc: David O'Brien cc: Nate Lawson Subject: Re: cvs commit: src/sys/kern subr_bus.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2004 09:09:39 -0000 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. julian