[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] docs/style: allow C99 mixed declarations
From: |
Alex Bennée |
Subject: |
Re: [PATCH] docs/style: allow C99 mixed declarations |
Date: |
Mon, 05 Feb 2024 23:17:27 +0000 |
User-agent: |
mu4e 1.11.27; emacs 29.1 |
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
Re: [PATCH] docs/style: allow C99 mixed declarations,
Alex Bennée <=
Re: [PATCH] docs/style: allow C99 mixed declarations, Stefan Hajnoczi, 2024/02/06