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

Jan Engelhardt
2006-03-16T19:55:43Z

>
>Is it any good?
>
Depends.

20:51 shanghai:/dev/shm > cat bool.c
#include <stdio.h>

int main(void) {
_Bool x = 0;
x += 2;
printf("%d\n", x);
}
20:51 shanghai:/dev/shm > gcc bool.c && ./a.out
1

It can't "overflow". If that's good or not I can't tell, and I can only
imagine an artifical scenario where it affects things:

void do_something_wrong(int *x) {
*x += 2;
}

int x = 0;
do_something_wrong(&x);
if(x & 1)
printf("x & 1");

>From this one, we would expect nothing to be printed. But if x was a _Bool
x (and _Bool *x, respectively), something would be printed.

Jan Engelhardt
--