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] [day] [month] [year] [list]
Date:   Fri, 24 May 2019 07:52:49 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] tracing: silence GCC 9 array bounds warning

On Fri, 24 May 2019 06:05:36 +0200
Miguel Ojeda <miguel.ojeda.sandonis@...il.com> wrote:

> On Fri, May 24, 2019 at 4:12 AM Steven Rostedt <rostedt@...dmis.org> wrote:
> >
> > On Thu, 23 May 2019 14:45:35 +0200
> > Miguel Ojeda <miguel.ojeda.sandonis@...il.com> wrote:
> >
> > I still prefer the typecast of void *, as that's used a bit more in the
> > kernel, but since char * is also used (not as much), I'll leave it. But
> > the parenthesis around iter are unnecessary. I'll remove them.  
> 
> If the preferred style in the kernel is void *, change it on your
> side, please! :-) Maybe we should mention it in the coding guidelines.
>

Well, it's not officially the preferred style. There's 240 uses of
(void *) in memset, compared to 98 uses of (char *)

$ git grep memset | grep '(void \*)' | wc -l
240

$ git grep memset | grep '(char \*)' | wc -l
98

I was about to make the conversion, but when I added addition to the
equation, the (char *) went ahead slightly:

$ git grep memset | grep '(void \*)' | grep '+' | wc -l
32

$ git grep memset | grep '(char \*)' | grep '+' | wc -l
35

Both are fine and legit, but as the weight is slightly higher doing
byte arithmetic with char *, I'll keep it as is.

-- STeve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ