[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1812031506200.23279@hadrien>
Date: Mon, 3 Dec 2018 15:07:07 +0100 (CET)
From: Julia Lawall <julia.lawall@...6.fr>
To: Peter Zijlstra <peterz@...radead.org>
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, 3 Dec 2018, Peter Zijlstra wrote:
> 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.
How about it it were suggested only in files that already use true and
false somewhere?
julia
Powered by blists - more mailing lists