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

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200111261551.fAQFpNY44638@aslan.scsiguy.com> "Justin T. Gibbs" writes:
: >imp         2001/11/25 21:42:46 PST
: >
: >  Modified files:
: >    sys/dev/pccbb        pccbb.c 
: >  Log:
: >  style(9) fixes:
: >          o declare variables at the start of the function, not the start of
: >            a block.
: 
: This is not a requirement of style(9) (at least not in -stable).
: C allows variables to have block only scope and we should allow
: the use of this feature of the language.

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.

Also, there were several of the form:

	foo();
	bar();

	{
		char *baz;
		baz = somefunc(...);
		otherfunc(baz, ...);
	}

which is just wrong.  The "safety" of limiting the scope like this is
offset by the pita factor of wrapping the function calls.

Warner

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?200111261627.fAQGRfM04124>