apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: cvs commit: apr/random/unix apr_random.c
Date Thu, 06 Nov 2003 18:15:41 GMT
trawick@apache.org wrote:
> trawick     2003/11/06 08:26:09
> 
>   Modified:    random/unix apr_random.c
>   Log:
>   fix an odd portability issue:
>   
>   Bit-field foo must be of type signed int, unsigned int or int.

Thanks.

BTW, on the subject of bitfield gotchas, never make boolean fields
signed - why? Coz:

struct x { signed int onebitfield:1; } x;
signed int someint;

x.onebitfield=TRUE;
someint=TRUE;

assert(x.onebitfield == someint);  /* SPLAT!!! */

Cheers,

Ben.

-- 
http://www.apache-ssl.org/ben.html       http://www.thebunker.net/

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff



Mime
View raw message