Message ID | 1395080791-18640-1-git-send-email-ehabkost@redhat.com |
---|---|
State | New |
Headers | show |
On 17 March 2014 18:26, Eduardo Habkost <ehabkost@redhat.com> wrote: > We had an unwritten rule about declarations having to be at beginning of > blocks. Make it a written rule. > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> > Reviewed-by: Stefan Weil <sw@weilnetz.de> > Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> -- PMM
17.03.2014 22:26, Eduardo Habkost wrote: > We had an unwritten rule about declarations having to be at beginning of > blocks. Make it a written rule. Thanks, applied to -trivial. /mjt
On 03/17/2014 07:26 PM, Eduardo Habkost wrote: > We had an unwritten rule about declarations having to be at beginning of > blocks. Make it a written rule. > Hello Eduardo, Is it possible to check this rule in script/checkpatch.pl? (or is it already?) Regards,
On Fri, Mar 21, 2014 at 07:04:08PM +0100, Fabien Chouteau wrote: > On 03/17/2014 07:26 PM, Eduardo Habkost wrote: > > We had an unwritten rule about declarations having to be at beginning of > > blocks. Make it a written rule. > > > > Hello Eduardo, > > Is it possible to check this rule in script/checkpatch.pl? (or is it already?) checkpatch.pl doesn't check it, currently. It is possible to check it, if somebody writes the code to do that.
diff --git a/CODING_STYLE b/CODING_STYLE index dcbce28..4280945 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -84,3 +84,10 @@ and clarity it comes on a line by itself: Rationale: a consistent (except for functions...) bracing style reduces ambiguity and avoids needless churn when lines are added or removed. Furthermore, it is the QEMU coding style. + +5. Declarations + +Mixed declarations (interleaving statements and declarations within blocks) +are not allowed; declarations should be at the beginning of blocks. In other +words, the code should not generate warnings if using GCC's +-Wdeclaration-after-statement option.