qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3] CODING_STYLE: Section about mixed declarations
@ 2014-03-17 18:26 Eduardo Habkost
  2014-03-17 18:28 ` Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Eduardo Habkost @ 2014-03-17 18:26 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: Peter Maydell, Paolo Bonzini, Andreas Färber, Stefan Weil

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>
---
Changes v3:
 * Wrap long lines

Changes v2:
 * s/be at beginning/be at the beginning/
---
 CODING_STYLE | 7 +++++++
 1 file changed, 7 insertions(+)

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.
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-03-21 18:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-17 18:26 [Qemu-devel] [PATCH v3] CODING_STYLE: Section about mixed declarations Eduardo Habkost
2014-03-17 18:28 ` Peter Maydell
2014-03-20 15:59 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2014-03-21 18:04 ` [Qemu-devel] " Fabien Chouteau
2014-03-21 18:17   ` Eduardo Habkost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).