From nobody Sat May 4 17:13:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1486144790230640.9801690852559; Fri, 3 Feb 2017 09:59:50 -0800 (PST) Received: from localhost ([::1]:36193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZi9D-0003YN-7z for importer@patchew.org; Fri, 03 Feb 2017 12:59:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZi8G-0003CJ-D9 for qemu-devel@nongnu.org; Fri, 03 Feb 2017 12:58:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZi8F-00075I-Oz for qemu-devel@nongnu.org; Fri, 03 Feb 2017 12:58:48 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:48391) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cZi8F-00074o-IO; Fri, 03 Feb 2017 12:58:47 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1cZi8B-0002gr-7R; Fri, 03 Feb 2017 17:58:43 +0000 From: Peter Maydell To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Date: Fri, 3 Feb 2017 17:58:42 +0000 Message-Id: <1486144722-6021-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Our defacto coding style strongly prefers /* */ style comments over the single-line // style, and checkpatch enforces this, but we don't actually document this. Mention it in CODING_STYLE. Suggested-by: Thomas Huth Signed-off-by: Peter Maydell Reviewed-by: Fam Zheng Reviewed-by: Laurent Vivier Reviewed-by: Stefan Hajnoczi --- CODING_STYLE | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CODING_STYLE b/CODING_STYLE index f53180b..2fa0c0b 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -116,3 +116,10 @@ if (a =3D=3D 1) { Rationale: Yoda conditions (as in 'if (1 =3D=3D a)') are awkward to read. Besides, good compilers already warn users when '=3D=3D' is mis-typed as '= =3D', even when the constant is on the right. + +7. Comment style + +We use traditional C-style /* */ comments and avoid // comments. + +Rationale: The // form is valid in C99, so this is purely a matter of +consistency of style. The checkpatch script will warn you about this. --=20 2.7.4