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:   Mon, 3 Dec 2018 11:50:45 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Julia Lawall <julia.lawall@...6.fr>
Cc:     "Paul E. McKenney" <paulmck@...ux.ibm.com>,
        Wen Yang <wen.yang99@....com.cn>,
        Davidlohr Bueso <dave@...olabs.net>,
        Josh Triplett <josh@...htriplett.org>,
        linux-kernel@...r.kernel.org, zhong.weidong@....com.cn,
        mingo@...hat.com, will.deacon@....com
Subject: Re: [PATCH] locktorture: Fix assignment of boolean variables

On Mon, Dec 03, 2018 at 10:20:42AM +0100, Julia Lawall wrote:
> Personally, I would prefer that assignments involving boolean variables
> use true or false.  It seems more readable.  Potentially better for tools
> as well.

Then those tools are broken per the C spec.

> But if the community really prefers 0 and 1, then the test can
> be deleted.

The C language spec, specifies _Bool as an integer type wide enough to
at least store 0 and 1.

IOW, 0 and 1 are perfectly valid valus to assign to a _Bool.

And fundamentally that has to be so. That's how computers work. 0 is
false, 1 is true.

The kernel is not the place to try and abstract such stuff, C is our
portable assembler. We muck with hardware, we'd better know how the heck
it works.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ