Re: [patch 1/1] consolidate TRUE and FALSE
From: Jan Engelhardt
Date: Thu Mar 16 2006 - 14:53:03 EST
>
>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
--
-
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/