From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIhHt-0007Bq-JD for qemu-devel@nongnu.org; Wed, 26 Feb 2014 11:24:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WIhHo-0004WN-5S for qemu-devel@nongnu.org; Wed, 26 Feb 2014 11:24:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIhHn-0004WF-T0 for qemu-devel@nongnu.org; Wed, 26 Feb 2014 11:24:44 -0500 From: Eduardo Habkost Date: Wed, 26 Feb 2014 13:24:29 -0300 Message-Id: <1393431869-24635-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH RESEND] CODING_STYLE: Section about mixed declarations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Stefan Weil , =?UTF-8?q?Andreas=20F=C3=A4rber?= , 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 Reviewed-by: Stefan Weil --- 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