[Scummvm-devel] Revisiting coding convention for empty loop body

Adrian Frühwirth scummvm-devel at bonki.net
Fri Apr 20 22:30:19 CEST 2018


Hi everybody,

Our CFCs currently state that trailing semicolons belonging to empty loops should be preceded by a space when on the
same line _and_ that the loop should be marked intentional with an appropriate comment. This was added to our CFCs after
a short discussion on -devel in 2010 [1].

A quick grep reveals that there is not a single occurrence with such a comment (at least not where the semicolon is on
the same line) and most also skip the preceding space.

The reason why this was proposed was that gcc warns about empty loop bodies when using -Wextra or -Wempty-body [2].
However, looking at our configure script, this warning seems to be disabled currently [3].

If we intend to keep the warning disabled I would like to drop the requirement for either the extra space or the
comment, having both seems a bit redundant. I'm in strong favor of keeping the comment (or rather, add it where
necessary) and drop the space before the semicolon.

Is anybody against this change?

-Adrian

[1] http://lists.scummvm.org/pipermail/scummvm-devel/2010-April/007554.html
[2] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
[3] https://github.com/scummvm/scummvm/blob/master/configure#L2033



More information about the Scummvm-devel mailing list