Revisiting coding convention for empty loop body

Adrian Frühwirth <[email protected]> Fri, 20 Apr 2018 22:30:19 +0200
Newsgroups gmane.games.devel.scummvm
Message-ID <[email protected]>
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

_______________________________________________
Scummvm-devel mailing list
[email protected]
http://lists.scummvm.org/listinfo/scummvm-devel