summaryrefslogtreecommitdiff
path: root/CODING_STYLE
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-02-03 17:58:42 +0000
committerMichael Tokarev <mjt@tls.msk.ru>2017-02-28 09:03:38 +0300
commit25ac5bbec43973e9b97a454e55fd307ef9db1320 (patch)
tree0c9db4a79cc55da44a2504dd9b1f27c0983cf584 /CODING_STYLE
parenta6e3707ece6b326e3fc5a086086a2ccac9710e67 (diff)
CODING_STYLE: Mention preferred comment form
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 <thuth@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'CODING_STYLE')
-rw-r--r--CODING_STYLE7
1 files changed, 7 insertions, 0 deletions
diff --git a/CODING_STYLE b/CODING_STYLE
index f53180bf3f..2fa0c0b65b 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.