[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PULL 05/14] CODING_STYLE: Mention preferred comment form
From: |
Michael Tokarev |
Subject: |
[Qemu-trivial] [PULL 05/14] CODING_STYLE: Mention preferred comment form |
Date: |
Tue, 28 Feb 2017 09:44:48 +0300 |
From: Peter Maydell <address@hidden>
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>
Reviewed-by: Markus Armbruster <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Michael Tokarev <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.1.4
- [Qemu-trivial] [PULL 00/14] Trivial patches for 2017-02-28, Michael Tokarev, 2017/02/28
- [Qemu-trivial] [PULL 06/14] ide: remove undefined behavior in ide-test, Michael Tokarev, 2017/02/28
- [Qemu-trivial] [PULL 01/14] target/s390x: Fix typo, Michael Tokarev, 2017/02/28
- [Qemu-trivial] [PULL 13/14] hw/acpi/tco.c: fix tco timer stop, Michael Tokarev, 2017/02/28
- [Qemu-trivial] [PULL 08/14] cadence_gem: Remove unused parameter debug message, Michael Tokarev, 2017/02/28
- [Qemu-trivial] [PULL 11/14] qemu-options.hx: add missing id=chr0 chardev argument in vhost-user example, Michael Tokarev, 2017/02/28
- [Qemu-trivial] [PULL 10/14] Update copyright year, Michael Tokarev, 2017/02/28
- [Qemu-trivial] [PULL 05/14] CODING_STYLE: Mention preferred comment form,
Michael Tokarev <=
- [Qemu-trivial] [PULL 14/14] syscall: fixed mincore(2) not failing with ENOMEM, Michael Tokarev, 2017/02/28
- [Qemu-trivial] [PULL 09/14] tests/prom-env: Enable the test for the sun4u machine, too, Michael Tokarev, 2017/02/28
- [Qemu-trivial] [PULL 12/14] lm32: milkymist-tmu2: fix a third integer overflow, Michael Tokarev, 2017/02/28
- [Qemu-trivial] [PULL 07/14] register: fix incorrect read mask, Michael Tokarev, 2017/02/28
- [Qemu-trivial] [PULL 02/14] softfloat: Use correct type in float64_to_uint64_round_to_zero(), Michael Tokarev, 2017/02/28
- [Qemu-trivial] [PULL 04/14] hw/core/register: Mark the device with cannot_instantiate_with_device_add_yet, Michael Tokarev, 2017/02/28
- [Qemu-trivial] [PULL 03/14] hw/core/or-irq: Mark the device with cannot_instantiate_with_device_add_yet, Michael Tokarev, 2017/02/28
- Re: [Qemu-trivial] [Qemu-devel] [PULL 00/14] Trivial patches for 2017-02-28, Peter Maydell, 2017/02/28