[OpenAFS-devel] Re: [PATCH] flexelint: punctuation fixes
Joe Buehler
jbuehler@hekimian.com
Tue, 02 Dec 2003 08:30:45 -0500
Jim Rees wrote:
> Where you have suggested changing
>
> for (side_effects);
>
> with
>
> for (side_effects) { /* empty */ }
>
> I would prefer this:
>
> for (side_effects)
> ;
>
> I think it will survive re-indentation better, and is a little more
> human-readable because it takes up an extra line.
The reason flexelint complains about this sort of thing is that it is
a potential bug -- the semicolon in the original may be a typo, or
may just be an unfinished statement -- maybe the author is in the habit
of typing for (;;); when starting a for statement.
Whether the semi should be elsewhere, or braces should be used,
or whatever, I don't think really matters, the point is to document
that the empty statement is intentional. Lots of different people will
look at the code over time and have no idea whether it is a bug.
So whatever is done, I think a comment should be added.
--
Joe Buehler