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]
Message-ID: <CAFULd4bR37GmvXC1oqbwry+HtZ0JqLz432CK69mSNkDsibmDaA@mail.gmail.com>
Date: Mon, 24 Feb 2025 08:56:59 +0100
From: Uros Bizjak <ubizjak@...il.com>
To: Jiri Slaby <jirislaby@...nel.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org, 
	Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>, 
	Dave Hansen <dave.hansen@...ux.intel.com>, "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH 1/2] x86/bootflag: Change some static functions to bool

On Mon, Feb 24, 2025 at 8:48 AM Jiri Slaby <jirislaby@...nel.org> wrote:
>
> On 24. 02. 25, 8:39, Uros Bizjak wrote:
> > The internal compiler representation of the following testcase:
> >
> > _Bool foo (int x) { return x; }
> >
> > is:
> >
> > --cut here--
> > _Bool foo (int x)
> > {
> >   _Bool _2;
> >
> >   <bb 2> [local count: 1073741824]:
> >   _2 = x_1(D) != 0;
> >   return _2;
>
> Yes, exactly as dictated by the C99 standard.
>
> > }
> > --cut here--
> >
> > For me, !!x in the source means that the change of types was
> > intentional. Surely, the compiler can do it by itself, so at the end
> > of the day, it is just a matter of personal taste.
>
> I've just learnt, that we even have that in CodingStyle:

Ugh, I didn't know that either... Thanks for the info.

Regarding the issue itself, I can create a follow-up patch that
removes !!x, or perhaps we can go all the way and substitute the
function with parity8() generic function, available in bitops.h.

Thanks,
Uros.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ