qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] CODING_STYLE: Mention preferred comment form
@ 2017-02-03 17:58 Peter Maydell
  2017-02-04 10:00 ` [Qemu-trivial] [Qemu-devel] " Markus Armbruster
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Peter Maydell @ 2017-02-03 17:58 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial; +Cc: patches, Thomas Huth

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>
---
 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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-02-15 10:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-03 17:58 [Qemu-trivial] [PATCH] CODING_STYLE: Mention preferred comment form Peter Maydell
2017-02-04 10:00 ` [Qemu-trivial] [Qemu-devel] " Markus Armbruster
2017-02-04 14:48 ` Fam Zheng
2017-02-05 18:02 ` [Qemu-trivial] " Laurent Vivier
2017-02-13 14:00 ` [Qemu-trivial] [Qemu-devel] " Stefan Hajnoczi
2017-02-15 10:17 ` [Qemu-trivial] " Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).