[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250510124711.6b5d8b9a@foz.lan>
Date: Sat, 10 May 2025 12:47:19 +0200
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Alexey Dobriyan <adobriyan@...il.com>
Cc: corbet@....net, workflows@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/9] CodingStyle: mention "typedef struct S {} S;" if
typedef is used
Em Fri, 9 May 2025 23:34:25 +0300
Alexey Dobriyan <adobriyan@...il.com> escreveu:
> Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
> ---
> Documentation/process/coding-style.rst | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst
> index ac9c1dbe00b7..5c5902a0f897 100644
> --- a/Documentation/process/coding-style.rst
> +++ b/Documentation/process/coding-style.rst
> @@ -443,6 +443,20 @@ EVER use a typedef unless you can clearly match one of those rules.
> In general, a pointer, or a struct that has elements that can reasonably
> be directly accessed should **never** be a typedef.
>
> +If you must use ``typedef`` consider using identical names for both the type
> +and its alias so that the type can be forward declared if necessary:
Better not, as symbols with duplicated names will generate a Sphinx warning (*).
(*) It shouldn't, but there is a pending issue on Sphinx since version 3.1
still not addressed:
https://github.com/sphinx-doc/sphinx/pull/8313
Regards,
Thanks,
Mauro
Powered by blists - more mailing lists