This is dangerous:
struct foo {
int bla:1;
};
int main()
{
struct foo f;
f.bla = 1;
printf("%d\n", f.bla);
}
$ ./a.out
-1
If you want to put "0" and "1" in a 1-bit field, use "unsigned int bla:1".
Mike.
-- .. somehow I have a feeling the hurting hasn't even begun yet -- Bill, "The Terrible Thunderlizards"- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/