Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Nov 2001 09:39:43 -0700
From:      "Justin T. Gibbs" <gibbs@scsiguy.com>
To:        Warner Losh <imp@harmony.village.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/dev/pccbb pccbb.c 
Message-ID:  <200111261639.fAQGdhY45463@aslan.scsiguy.com>
In-Reply-To: Your message of "Mon, 26 Nov 2001 09:27:41 MST." <200111261627.fAQGRfM04124@harmony.village.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111261639.fAQGdhY45463>