Re: RFC: booleans and the kernel

Robert Love
2002-01-24T22:34:23Z

On Fri, 2002-01-25 at 17:30, Timothy Covell wrote:
>
> On Thursday 24 January 2002 16:19, Robert Love wrote:
> > how is "if (x)" any less legit if x is an integer ?
>
> What about
>
> {
> char x;
>
> if ( x )
> {
> printf ("\n We got here\n");
> }
> else
> {
> // We never get here
> printf ("\n We never got here\n");
> }
> }
>
>
> That's not what I want. It just seems too open to bugs
> and messy IHMO.

When would you ever use the above code? Your reasoning is "you may
accidentally check a char for a boolean value." In other words, not
realize it was a char. What is to say its a boolean? Or not? This
isn't an argument. How does having a boolean type solve this? Just use
an int.

Robert Love