Re: [RFC][PATCH] A generic boolean (version 6)

From: ricknu-0
Date: Thu Jul 27 2006 - 00:00:57 EST

Citerar Josef Sipek <jsipek@xxxxxxxxxxxxxxxxx>:

> On Wed, Jul 26, 2006 at 06:06:22PM -0700, Paul Jackson wrote:
> > Richard wrote:
> > > * removed the #undef false/true and #define false/true
> >
> > Good - thanks.
> >
> > +enum {
> > + false = 0,
> > + true = 1
> > +};
> You probably have said it before, but why do we need this?

Well Jeff, there is no _need_ for the false and true, but it makes the code more
readable to many of us. (Why else is there all these definitions of false and true?)
There is other opinions on this and that is one of the reason* bool isn't
defined as:

enum { false, true } bool;

letting us choose our own way.
So when (hopefully) the converting to these starts, it will only affect the
files already using some sort of false and true. If the author is more
comfortable with 0 and 1's, that will be respectet (by me, at least).

Hope it make some sense.

> Josef "Jeff" Sipek.

/Richard Knutsson

If I got you wrong and you meant why it can't be defined where it is used, I
refere you to Andrew's mail "[patch 1/1] consolidate TRUE and FALSE", where a
redefinition occured (of TRUE/FALSE).

* another is that C99 defines the boolean type for us (as _Bool).

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at