]> git.ipfire.org Git - thirdparty/systemd.git/commit
CODING_STYLE: allow c99-style mixed code and declarations
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 7 Jun 2018 13:08:02 +0000 (15:08 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 7 Jun 2018 14:42:34 +0000 (16:42 +0200)
commitd40f5cc498a781bb2fc7b465c7be4372444754ed
tree0591a16224eefad6a3ff1049aa1f1dc85b9d4478
parente02a33c2b7f7f084743a127d1b98a2aecf477601
CODING_STYLE: allow c99-style mixed code and declarations

We already allowed variables to be declared in the middle of a function
(whenever a new scope was opened), so this isn't such a big change. Sometimes
we would open a scope just to work around this prohibition.

But sometimes the code can be much clearer if the variable is declared
somewhere in the middle of a scope, in particular if the declaration is
combined with initialization or acquisition of some resources. So let's allow
this, but keep things in the old style, unless there's a good reason to move
the variable declaration to a different place.
doc/CODING_STYLE
meson.build