From owner-cvs-all Mon Nov 26 8:39:53 2001 Delivered-To: cvs-all@freebsd.org Received: from aslan.scsiguy.com (aslan.scsiguy.com [63.229.232.106]) by hub.freebsd.org (Postfix) with ESMTP id DA65037B416; Mon, 26 Nov 2001 08:39:46 -0800 (PST) Received: from scsiguy.com (localhost [127.0.0.1]) by aslan.scsiguy.com (8.11.5/8.11.5) with ESMTP id fAQGdhY45463; Mon, 26 Nov 2001 09:39:43 -0700 (MST) (envelope-from gibbs@scsiguy.com) Message-Id: <200111261639.fAQGdhY45463@aslan.scsiguy.com> To: Warner Losh Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/pccbb pccbb.c In-Reply-To: Your message of "Mon, 26 Nov 2001 09:27:41 MST." <200111261627.fAQGRfM04124@harmony.village.org> Date: Mon, 26 Nov 2001 09:39:43 -0700 From: "Justin T. Gibbs" Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >Yes it is a requirement of style(9), even in -stable: > > Parts of a for loop may be left empty. Don't put declarations inside > blocks unless the routine is unusually complicated. > >None of the functions were anywhere near complex enough. Complex is in the eyes of the programmer. In this case, I might agree with the removal of the local variable, but not for reasons specified in style(9). If your example is accurate, the block in question was not a "natureal block" (the body of a conditional statement), and is rarely appropriate. In most cases it indicates that a subsection of the fuction should be broken out into an separate function (perhaps inline). Anyway, style(9) cannot handle all situations. Style(9) has to allow the programmer to use their brain. That is why the above is not a hard and fast rule. -- Justin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message