From: Eduardo Habkost Date: Mon, 17 Mar 2014 18:26:31 +0000 (-0300) Subject: CODING_STYLE: Section about mixed declarations X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e939c6ed619e2cf98c379318f6ee389c97163f18;p=qemu.git CODING_STYLE: Section about mixed declarations We had an unwritten rule about declarations having to be at beginning of blocks. Make it a written rule. Signed-off-by: Eduardo Habkost Reviewed-by: Stefan Weil Reviewed-by: Markus Armbruster Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- diff --git a/CODING_STYLE b/CODING_STYLE index dcbce28a27..4280945ff0 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.