[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH] CODING_STYLE: Define our preferr
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH] CODING_STYLE: Define our preferred form for multiline comments |
Date: |
Mon, 4 Jun 2018 16:10:49 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 06/04/2018 01:21 PM, Peter Maydell wrote:
> The codebase has a bit of a mix of
> /* multiline comments
> * like this
> */
> and
> /* multiline comments like this
> in the GNU Coding Standards style */
>
> State a preference for the former.
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> I admit that to some extent I'm imposing my aesthetic
> preferences here; pretty sure we have a lot more style
> 1 comments than style 2, though.
The later is easier to indent with unintelligent editors.
Any one is fine as long as it has a guideline in coding style.
> ---
> CODING_STYLE | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/CODING_STYLE b/CODING_STYLE
> index 12ba58ee293..fb1d1f1cd62 100644
> --- a/CODING_STYLE
> +++ b/CODING_STYLE
> @@ -124,6 +124,19 @@ 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.
>
> +Multiline comments blocks should have a row of stars on the left
> +and the terminating */ on its own line:
> + /* like
> + * this
> + */
> +Putting the initial /* on its own line is accepted, but not required.
> +(Some of the existing comments in the codebase use the GNU Coding
> +Standards form which does not have stars on the left; avoid this
> +when writing new comments.)
> +
> +Rationale: Consistency, and ease of visually picking out a multiline
> +comment from the surrounding code.
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> +
> 8. trace-events style
>
> 8.1 0x prefix
>