On Sat, May 10, 2025 at 12:47:19PM +0200, Mauro Carvalho Chehab wrote:
> Em Fri,  9 May 2025 23:34:25 +0300
> Alexey Dobriyan <adobri...@gmail.com> escreveu:
> 
> > Signed-off-by: Alexey Dobriyan <adobri...@gmail.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

OMG, so we are at mercy of static checkers _and_ documentation system? now

I've realised, changelog is bady worded:

Some people invent styles when typedef'ing struct/union:

        typedef struct xxx_s {} xxx;
        typedef struct _xxx {} xxx;

There is no reason to do that, just typedef to exact same name.

Reply via email to