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]
Date:   Tue, 28 Nov 2023 16:48:53 -0800
From:   Joe Perches <joe@...ches.com>
To:     Przemek Kitszel <przemyslaw.kitszel@...el.com>,
        Andy Whitcroft <apw@...onical.com>,
        linux-kernel@...r.kernel.org
Cc:     Jacob Keller <jacob.e.keller@...el.com>,
        Dwaipayan Ray <dwaipayanray1@...il.com>,
        Lukas Bulwahn <lukas.bulwahn@...il.com>
Subject: Re: [PATCH] checkpatch: don't complain on _Static_assert and
 _Generic use

On Tue, 2023-11-28 at 11:25 +0100, Przemek Kitszel wrote:
> On 11/28/23 01:46, Joe Perches wrote:
> > On Mon, 2023-11-27 at 16:18 +0100, Przemek Kitszel wrote:
> > > Improve CamelCase recognition logic to avoid reporting on _Static_assert()
> > > and _Generic() use.
> > > 
> > > Other C keywords, such as _Bool, are intentionally omitted, as those
> > > should be rather avoided in new source code.
> > []
> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > []
> > > @@ -5839,6 +5839,8 @@ sub process {
> > >   #CamelCase
> > >   			if ($var !~ /^$Constant$/ &&
> > >   			    $var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
> > > +#Ignore C keywords
> > > +			    $var !~ /_Static_assert|_Generic/ &&
> > 
> > You'll need
> > 
> > 			    $var != /^(?:_Static_assert|_Generic)$/ &&

Hi again.

btw:  Looks like adding _Pragma would be useful too.

$ git grep -ohP '\b_\w+' -- '*.[ch]' | \
  sort | uniq -c | sort -rn | \
  grep -P '[a-z][A-Z]|[A-Z][a-z]' | \
  head -30
    377 __Value
    206 __pH2CCmd
    152 __pTxDesc
     78 _Pragma
     54 __pRxDesc
     52 __pRxStatusDesc
     50 _Generic
     48 _Static_assert
     41 _PyUnicode_FromString
     30 _pEleStart
     29 _PyLong_FromLong
     26 _NonStandardParameter
     24 _txOff
     24 _TransportAddress
     23 _txOn
     23 _Bool
     22 _Lxx
     21 _Exx
     19 _min_uV
     18 _StateArray
     18 _NonClockInfoArray
     18 _ClockInfoArray
     16 _8Mx32
     16 _32Mx16
     16 _16Mx32
     16 _16Mx16
     15 _REGIc
     13 _step_uV
     13 _Set_Drv_Extra
     13 __PageMovable

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ