lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DS0PR11MB6373E6DC5F6FF3EB4824668ADCB69@DS0PR11MB6373.namprd11.prod.outlook.com>
Date:   Mon, 6 Mar 2023 11:03:20 +0000
From:   "Wang, Wei W" <wei.w.wang@...el.com>
To:     Jonathan Corbet <corbet@....net>, "arnd@...db.de" <arnd@...db.de>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "keescook@...omium.org" <keescook@...omium.org>,
        "herbert@...dor.apana.org.au" <herbert@...dor.apana.org.au>,
        "josh@...htriplett.org" <josh@...htriplett.org>,
        "Nikula, Jani" <jani.nikula@...el.com>,
        "jgg@...lanox.com" <jgg@...lanox.com>,
        "dmatlack@...gle.com" <dmatlack@...gle.com>,
        "mizhang@...gle.com" <mizhang@...gle.com>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "Christopherson,, Sean" <seanjc@...gle.com>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v1 2/3] Documentation/CodingStyle: do not use data type
 names as variable names

On Saturday, March 4, 2023 11:02 PM, Jonathan Corbet wrote:
> Wei Wang <wei.w.wang@...el.com> writes:
> 
> > Observed some merged code uses "bool" as variable name. This is
> > confusion either for the reader or compilier. Add a rule to have
> > programmers avoid using data types as variable names.
> >
> > Signed-off-by: Wei Wang <wei.w.wang@...el.com>
> > ---
> >  Documentation/process/coding-style.rst | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/Documentation/process/coding-style.rst
> > b/Documentation/process/coding-style.rst
> > index 007e49ef6cec..6d7f4069d55d 100644
> > --- a/Documentation/process/coding-style.rst
> > +++ b/Documentation/process/coding-style.rst
> > @@ -356,6 +356,9 @@ specification that mandates those terms. For new
> > specifications  translate specification usage of the terminology to
> > the kernel coding  standard where possible.
> >
> > +"bool", "int", "long" etc. are specific names for data types, C
> > +programmers should not use them as variable names.
> 
> It seems you found one place where bool was being misused.  Fixing it was
> certainly the right thing to do, but I'm not convinced we need to add clutter
> to the documentation for this.

OK. I thought people would not name it in this way. But it indeed happened,
and I don't find we have such rules officially documented anywhere.
Fine if you (or most people) think that's not necessary, though.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ