httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@worldgate.com>
Subject Re: bitfields and negative
Date Sat, 07 Mar 1998 16:45:57 GMT
On Sat, 7 Mar 1998, Ben Laurie wrote:

> typedef int BOOL;
> 
> struct thing
> 	{
> 	BOOL x:1;
> 	};
> 
> BOOL Compare(struct thing *p,BOOL b)
> 	{ return p->x == b; }
> 
> Why? Coz TRUE is 1, but a one bit signed bitfield can only have values 0
> and -1.

My understanding was that some compilers default to signed, some default
to unsigned if it is not specified...


Mime
View raw message