From patchwork Mon Mar 17 18:26:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 331114 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EA7A32C00AC for ; Tue, 18 Mar 2014 05:28:13 +1100 (EST) Received: from localhost ([::1]:59622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPcGg-0000zl-2P for incoming@patchwork.ozlabs.org; Mon, 17 Mar 2014 14:28:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPcFe-000891-ML for qemu-devel@nongnu.org; Mon, 17 Mar 2014 14:27:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPcFZ-0006Dk-R3 for qemu-devel@nongnu.org; Mon, 17 Mar 2014 14:27:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPcFZ-0006DX-Jd; Mon, 17 Mar 2014 14:27:01 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2HIQvUS005485 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 17 Mar 2014 14:26:58 -0400 Received: from localhost ([10.3.113.8]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s2HIQurH001963; Mon, 17 Mar 2014 14:26:57 -0400 From: Eduardo Habkost To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Date: Mon, 17 Mar 2014 15:26:31 -0300 Message-Id: <1395080791-18640-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Stefan Weil Subject: [Qemu-devel] [PATCH v3] CODING_STYLE: Section about mixed declarations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Reviewed-by: Markus Armbruster Reviewed-by: Peter Maydell --- 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.