* [Qemu-devel] [PATCH RESEND] CODING_STYLE: Section about mixed declarations
@ 2014-02-26 16:24 Eduardo Habkost
2014-02-27 6:55 ` Markus Armbruster
0 siblings, 1 reply; 2+ messages in thread
From: Eduardo Habkost @ 2014-02-26 16:24 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Stefan Weil, Andreas Färber, Peter Maydell
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>
---
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..efa5cc3 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] 2+ messages in thread
* Re: [Qemu-devel] [PATCH RESEND] CODING_STYLE: Section about mixed declarations
2014-02-26 16:24 [Qemu-devel] [PATCH RESEND] CODING_STYLE: Section about mixed declarations Eduardo Habkost
@ 2014-02-27 6:55 ` Markus Armbruster
0 siblings, 0 replies; 2+ messages in thread
From: Markus Armbruster @ 2014-02-27 6:55 UTC (permalink / raw)
To: Eduardo Habkost
Cc: Peter Maydell, Paolo Bonzini, qemu-devel, Andreas Färber,
Stefan Weil
Eduardo Habkost <ehabkost@redhat.com> writes:
> 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>
> ---
> 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..efa5cc3 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.
Long lines. We'll live.
I'd like to see either arguments or a commit. For good measure:
Reviewed-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-27 6:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-26 16:24 [Qemu-devel] [PATCH RESEND] CODING_STYLE: Section about mixed declarations Eduardo Habkost
2014-02-27 6:55 ` Markus Armbruster
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).