Re: [patch 1/1] consolidate TRUE and FALSE

From: Jan Engelhardt
Date: Thu Mar 16 2006 - 14:56:41 EST


>> of course. but that it's not used in core code implies this opinion is
>> widely shared.
>
>[...] To me it is a simple consequence of there not
>being a boolean type in the kernel so you cannot use it in the core code.

typedef bool int;

And then happily use if(EXPR) and if(!EXPR) instead of if(EXPR == TRUE) or
if(EXPR == FALSE). :-)

But typedeffing it to int (or unsigned char, if someone likes that
for space optimization) does not "catch overflows" (see another lkml
mail from me) as _Bool would.


Jan Engelhardt
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/