[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181203105045.GD11573@hirez.programming.kicks-ass.net>
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