[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH] CODING_STYLE: Mention preferred comment form
From: |
Peter Maydell |
Subject: |
[Qemu-trivial] [PATCH] CODING_STYLE: Mention preferred comment form |
Date: |
Fri, 3 Feb 2017 17:58:42 +0000 |
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 <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
---
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.
--
2.7.4
- [Qemu-trivial] [PATCH] CODING_STYLE: Mention preferred comment form,
Peter Maydell <=
- Re: [Qemu-trivial] [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form, Markus Armbruster, 2017/02/04
- Re: [Qemu-trivial] [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form, Fam Zheng, 2017/02/04
- Re: [Qemu-trivial] [PATCH] CODING_STYLE: Mention preferred comment form, Laurent Vivier, 2017/02/05
- Re: [Qemu-trivial] [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form, Stefan Hajnoczi, 2017/02/13
- Re: [Qemu-trivial] [PATCH] CODING_STYLE: Mention preferred comment form, Michael Tokarev, 2017/02/15