Re: Revisiting coding convention for empty loop body

Paul Gilbert <[email protected]> Sat, 21 Apr 2018 06:54:41 -0400
Newsgroups gmane.games.devel.scummvm
Message-ID <CAEkg9ROXQ8gUykVO2D7ZV5SfT3tYF3thjMn+r1m8pOAyXkJB4A@mail.gmail.com>
Hmmm.. if we'd need to do some form of change to existing code to , I'd be
more in favor of mandating the use of {} rather than the semicolon, as
opposed to requiring an entire comment just to say that it's intentional
that the loop doesn't have a body. It would convey the same information, in
a more compact form. And it would have the advantage of bypassing the
question of whether semicolons should have spaces in front of them.

Paul.

On Fri, Apr 20, 2018 at 4:30 PM, Adrian Frühwirth <[email protected]>
wrote:

> 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
>

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