Re: -rc7 Re: Linux 2.4.21-rc6

Miquel van Smoorenburg
2003-06-04T12:22:15Z

In article <3EDDDEBB.4080209@cyberone.com.au>,
Nick Piggin <piggin@cyberone.com.au> wrote:
>- char plugged;
>+ int plugged:1;

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"