From: "Alex Bennée" <alex.bennee@linaro.org>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, "Hanna Czenczek" <hreitz@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Thomas Huth" <thuth@redhat.com>
Subject: Re: [PATCH] docs/style: allow C99 mixed declarations
Date: Mon, 05 Feb 2024 23:17:27 +0000 [thread overview]
Message-ID: <87fry6mrg8.fsf@draig.linaro.org> (raw)
In-Reply-To: <20240205171819.474283-1-stefanha@redhat.com> (Stefan Hajnoczi's message of "Mon, 5 Feb 2024 12:18:19 -0500")
Stefan Hajnoczi <stefanha@redhat.com> writes:
> C99 mixed declarations support interleaving of local variable
> declarations and code.
>
> The coding style "generally" forbids C99 mixed declarations with some
> exceptions to the rule. This rule is not checked by checkpatch.pl and
> naturally there are violations in the source tree.
>
> While contemplating adding another exception, I came to the conclusion
> that the best location for declarations depends on context. Let the
> programmer declare variables where it is best for legibility. Don't try
> to define all possible scenarios/exceptions.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> docs/devel/style.rst | 20 --------------------
> 1 file changed, 20 deletions(-)
While I may be convinced there may be some cases where mixed
declarations could make things simpler/clearer I don't support removing
all the guidance and leaving it as a free for all as long as the
compiler is happy.
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2024-02-05 23:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 17:18 [PATCH] docs/style: allow C99 mixed declarations Stefan Hajnoczi
2024-02-05 17:41 ` Daniel P. Berrangé
2024-02-05 17:55 ` Peter Maydell
2024-02-05 18:12 ` Samuel Tardieu
2024-02-05 19:06 ` Stefan Hajnoczi
2024-02-05 19:17 ` Daniel P. Berrangé
2024-02-06 5:53 ` Markus Armbruster
2024-02-07 5:28 ` Philippe Mathieu-Daudé
2024-02-07 7:37 ` Markus Armbruster
2024-02-05 23:17 ` Alex Bennée [this message]
2024-02-06 13:48 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fry6mrg8.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=hreitz@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.