On 9 February 2014 00:10, Peter Maydell <peter.mayd...@linaro.org> wrote: > On 8 February 2014 23:33, Paolo Bonzini <pbonz...@redhat.com> wrote: >> Il 08/02/2014 18:28, Andreas Färber ha scritto: >>> Since when is it OK to declare variables in the middle of the block? > >> When the code looks better, it is OK since always: checkpatch.pl doesn't >> complain and -Wdeclaration-after-statement is not added to the compiler >> flags. > > Huh? checkpatch is notoriously not a reliable guide, and we've had > the "declarations at start of block" rule since forever.
FWIW, we have just 39 files[*] which fail to follow the "declarations at start of block" rule out of 2566, which is pretty good compliance for a coding style rule which isn't enforced by technical means (I expect it's much better than we achieve for "no hard tabs" or "braces on all if statement arms", for instance). [*] as tested by a compile with -Wdeclaration-after-statement, so slightly undercounting but not I think seriously. thanks -- PMM