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: <7856ccb5-d848-416a-bb6c-e3bcdc03aebe@kernel.org>
Date: Fri, 7 Mar 2025 11:52:52 +0100
From: Jiri Slaby <jirislaby@...nel.org>
To: Kuan-Wei Chiu <visitorckw@...il.com>, "H. Peter Anvin" <hpa@...or.com>,
 longman@...hat.com, llong@...hat.com
Cc: tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
 dave.hansen@...ux.intel.com, x86@...nel.org, jk@...abs.org, joel@....id.au,
 eajames@...ux.ibm.com, andrzej.hajda@...el.com, neil.armstrong@...aro.org,
 rfoss@...nel.org, maarten.lankhorst@...ux.intel.com, mripard@...nel.org,
 tzimmermann@...e.de, airlied@...il.com, simona@...ll.ch,
 dmitry.torokhov@...il.com, mchehab@...nel.org, awalls@...metrocast.net,
 hverkuil@...all.nl, miquel.raynal@...tlin.com, richard@....at,
 vigneshr@...com, louis.peens@...igine.com, andrew+netdev@...n.ch,
 davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
 parthiban.veerasooran@...rochip.com, arend.vanspriel@...adcom.com,
 johannes@...solutions.net, gregkh@...uxfoundation.org, yury.norov@...il.com,
 akpm@...ux-foundation.org, alistair@...ple.id.au, linux@...musvillemoes.dk,
 Laurent.pinchart@...asonboard.com, jonas@...boo.se,
 jernej.skrabec@...il.com, kuba@...nel.org, linux-kernel@...r.kernel.org,
 linux-fsi@...ts.ozlabs.org, dri-devel@...ts.freedesktop.org,
 linux-input@...r.kernel.org, linux-media@...r.kernel.org,
 linux-mtd@...ts.infradead.org, oss-drivers@...igine.com,
 netdev@...r.kernel.org, linux-wireless@...r.kernel.org,
 brcm80211@...ts.linux.dev, brcm80211-dev-list.pdl@...adcom.com,
 linux-serial@...r.kernel.org, bpf@...r.kernel.org, jserv@...s.ncku.edu.tw,
 Yu-Chun Lin <eleanor15x@...il.com>
Subject: Re: [PATCH v3 00/16] Introduce and use generic parity16/32/64 helper

On 07. 03. 25, 10:19, Kuan-Wei Chiu wrote:
> I used to believe that casting a boolean variable to int would always
> result in 0 or 1 until a few months ago when Waiman Long explicitly
> pointed out during a review that C does not guarantee this.
> 
> So I revisited the C11 standard, which states that casting to _Bool
> always results in 0 or 1 [1]. Another section specifies that bool,
> true, and false are macros defined in <stdbool.h>, with true expanding
> to 1 and false to 0. However, these macros can be #undef and redefined
> to other values [2].

Note that we do not have/use user's stdbool.h in kernel at all. Instead, 
in linux/stddef.h, we define:
enum {
         false   = 0,
         true    = 1
};

So all is blue.

thanks,
-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ