Skip to content

Commit

Permalink
CODING_STYLE: Section about mixed declarations
Browse files Browse the repository at this point in the history
We had an unwritten rule about declarations having to be at beginning of
blocks. Make it a written rule.

Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Stefan Weil <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
  • Loading branch information
ehabkost authored and Michael Tokarev committed Mar 27, 2014
1 parent 340fb41 commit e939c6e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CODING_STYLE
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit e939c6e

Please sign in to comment.