All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH v3] CODING_STYLE: Section about mixed declarations
@ 2014-03-17 18:26 ` Eduardo Habkost
  0 siblings, 0 replies; 10+ 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] 10+ messages in thread

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

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.