From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ca1e9-0000WJ-PH for qemu-devel@nongnu.org; Sat, 04 Feb 2017 09:49:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ca1e6-0008Fr-JT for qemu-devel@nongnu.org; Sat, 04 Feb 2017 09:49:01 -0500 Date: Sat, 4 Feb 2017 22:48:54 +0800 From: Fam Zheng Message-ID: <20170204144854.GC15362@lemon> References: <1486144722-6021-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1486144722-6021-1-git-send-email-peter.maydell@linaro.org> Subject: Re: [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org, Thomas Huth , patches@linaro.org On Fri, 02/03 17:58, Peter Maydell wrote: > 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 > --- > 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 == 1) { > Rationale: Yoda conditions (as in 'if (1 == a)') are awkward to read. > Besides, good compilers already warn users when '==' is mis-typed as '=', > 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. Reviewed-by: Fam Zheng