lkml.org 
[lkml]   [2003]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: -rc7 Re: Linux 2.4.21-rc6
Date
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"

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.209 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site