From: David Miller
> From: Linus Torvalds
> Date: Mon, 10 Mar 2014 19:02:18 -0700
>
> > I would generally suggest that people only use "bool" for function
> > return types, and absolutely nothing else. Seriously.
>
> I think it makes sense for function arguments too.
'bool' doesn't necessarily
From: David Miller
From: Linus Torvalds torva...@linux-foundation.org
Date: Mon, 10 Mar 2014 19:02:18 -0700
I would generally suggest that people only use bool for function
return types, and absolutely nothing else. Seriously.
I think it makes sense for function arguments too.
'bool'
On Mon, Mar 10, 2014 at 7:33 PM, H. Peter Anvin wrote:
> Why not for variables?
My dislike of "bool" comes from the fact that you historically can't *trust* it.
I guess it's becoming trustworthy these days, but quite often,
traditionally, "bool" ended up being just another word for "char",
On Mon, 2014-03-10 at 19:02 -0700, Linus Torvalds wrote:
> On Mon, Mar 10, 2014 at 6:51 PM, David Miller wrote:
> > From: Alexei Starovoitov
> > Date: Sun, 9 Mar 2014 23:04:02 -0700
> >
> >> + unsigned intjited:1;
> >
> > The C language has a proper type for boolean states,
On Mon, Mar 10, 2014 at 7:20 PM, H. Peter Anvin wrote:
> Bool vs bitfield are orthogonal, at least under gcc, unless I'm completely
> out to sea. It is probably not a good idea to create a bitfield when it
> doesn't buy you anything, lest you generate rmw instructions when byte stores
> would
From: "H. Peter Anvin"
Date: Mon, 10 Mar 2014 19:33:03 -0700
> Why not for variables? It makes a lot of sense of nothing else to
> avoid the confusion that invariably happens when someone decides to
> introduce the value 2 or -1 to an existing variable (and yes, thus
> has happened a number of
Why not for variables? It makes a lot of sense of nothing else to avoid the
confusion that invariably happens when someone decides to introduce the value 2
or -1 to an existing variable (and yes, thus has happened a number of times.)
Not to mention they take a single byte rather than four for
Bool vs bitfield are orthogonal, at least under gcc, unless I'm completely out
to sea. It is probably not a good idea to create a bitfield when it doesn't
buy you anything, lest you generate rmw instructions when byte stores would do.
On March 10, 2014 7:02:18 PM PDT, Linus Torvalds
wrote:
From: Linus Torvalds
Date: Mon, 10 Mar 2014 19:02:18 -0700
> I would generally suggest that people only use "bool" for function
> return types, and absolutely nothing else. Seriously.
I think it makes sense for function arguments too.
--
To unsubscribe from this list: send the line "unsubscribe
On Mon, Mar 10, 2014 at 7:02 PM, Linus Torvalds
wrote:
>
> So please don't sell "bool" as some kind of panacea. It has at least
> as many problems as it has advantages.
Side note: not that bitfields are all that great either, partly
because gcc tends to occasionally generate absolutely
On Mon, Mar 10, 2014 at 6:51 PM, David Miller wrote:
> From: Alexei Starovoitov
> Date: Sun, 9 Mar 2014 23:04:02 -0700
>
>> + unsigned intjited:1;
>
> The C language has a proper type for boolean states, please therefore
> use 'bool', true, and false.
No, the C standard
From: Alexei Starovoitov
Date: Sun, 9 Mar 2014 23:04:02 -0700
> + unsigned intjited:1;
The C language has a proper type for boolean states, please therefore
use 'bool', true, and false.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a
From: Alexei Starovoitov a...@plumgrid.com
Date: Sun, 9 Mar 2014 23:04:02 -0700
+ unsigned intjited:1;
The C language has a proper type for boolean states, please therefore
use 'bool', true, and false.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
On Mon, Mar 10, 2014 at 6:51 PM, David Miller da...@davemloft.net wrote:
From: Alexei Starovoitov a...@plumgrid.com
Date: Sun, 9 Mar 2014 23:04:02 -0700
+ unsigned intjited:1;
The C language has a proper type for boolean states, please therefore
use 'bool', true, and false.
On Mon, Mar 10, 2014 at 7:02 PM, Linus Torvalds
torva...@linux-foundation.org wrote:
So please don't sell bool as some kind of panacea. It has at least
as many problems as it has advantages.
Side note: not that bitfields are all that great either, partly
because gcc tends to occasionally
From: Linus Torvalds torva...@linux-foundation.org
Date: Mon, 10 Mar 2014 19:02:18 -0700
I would generally suggest that people only use bool for function
return types, and absolutely nothing else. Seriously.
I think it makes sense for function arguments too.
--
To unsubscribe from this list:
Bool vs bitfield are orthogonal, at least under gcc, unless I'm completely out
to sea. It is probably not a good idea to create a bitfield when it doesn't
buy you anything, lest you generate rmw instructions when byte stores would do.
On March 10, 2014 7:02:18 PM PDT, Linus Torvalds
Why not for variables? It makes a lot of sense of nothing else to avoid the
confusion that invariably happens when someone decides to introduce the value 2
or -1 to an existing variable (and yes, thus has happened a number of times.)
Not to mention they take a single byte rather than four for
From: H. Peter Anvin h...@zytor.com
Date: Mon, 10 Mar 2014 19:33:03 -0700
Why not for variables? It makes a lot of sense of nothing else to
avoid the confusion that invariably happens when someone decides to
introduce the value 2 or -1 to an existing variable (and yes, thus
has happened a
On Mon, Mar 10, 2014 at 7:20 PM, H. Peter Anvin h...@zytor.com wrote:
Bool vs bitfield are orthogonal, at least under gcc, unless I'm completely
out to sea. It is probably not a good idea to create a bitfield when it
doesn't buy you anything, lest you generate rmw instructions when byte
On Mon, 2014-03-10 at 19:02 -0700, Linus Torvalds wrote:
On Mon, Mar 10, 2014 at 6:51 PM, David Miller da...@davemloft.net wrote:
From: Alexei Starovoitov a...@plumgrid.com
Date: Sun, 9 Mar 2014 23:04:02 -0700
+ unsigned intjited:1;
The C language has a proper type
On Mon, Mar 10, 2014 at 7:33 PM, H. Peter Anvin h...@zytor.com wrote:
Why not for variables?
My dislike of bool comes from the fact that you historically can't *trust* it.
I guess it's becoming trustworthy these days, but quite often,
traditionally, bool ended up being just another word for
22 matches
Mail list logo