cvs commit: src/sys/dev/ed if_ed.c

Bruce Evans bde at zeta.org.au
Fri Feb 11 11:31:52 GMT 2005


On Thu, 10 Feb 2005, M. Warner Losh wrote:

> In message: <20050210155027.B49218 at xorpc.icir.org>
>             Luigi Rizzo <rizzo at icir.org> writes:
> : hm... it would have sufficed (and more obvious)
> : to just put an empty statement without the 'continue' ?
> :
> : 	while (complicated-expr)
> : 		;
>
> No.

But a bare ";" is a normal style (The Normal Style?), and is idomatic
for C programmers.  It is used in more than 100 lines in Lite2's /sys
and in more than 200 lines in -current's /sys.  It is only commented
on in about 15% of the cases in -current.  Bare "continue;"s are harder
to grep for so I didn't look for them.

The original bug:

 	while (complicated-expr);

may be just a style bug written by indent(1).  indent(1) messes up
loops with only a ";" statement in them, and this can be "fixed" using
"continue;" but not using "; /* nothing */".

Bruce


More information about the cvs-all mailing list