On 08/19/10 10:10, Avi Kivity wrote: > On 08/19/2010 10:58 AM, Jes Sorensen wrote: >> >>> In C99, bool is a real type. >> Kinda real, I would qualify it more as a pseudo type. It doesn't map to >> any register size or even instruction actions. > > Neither do int, short, long, long long, or signed short long float.
Well most processors support 32 bit register ops, even when running in 64 bit mode. long is the maximum register size in pretty much any sane setup, which is why it is such a mess that M$ took the easy way out when they picked for win64. Tons of user code will have portability problems because of this. >> Most processors, at least >> the ones I have programmed, tend to treat it as zero == false, >> everything else == true. > > Processors don't have _Bool. No but something has to generate code to handle it. >> For structure packing it's ugly. > > Use uint*_t for externally visible structures. use _Bool for internal > booleans. Structure packing is more than passing structures to external processes or saving them, it's also cache line alignment. In your case we should change pretty much any data structure in QEMU that is in a critical data path to use *int*_t. Jes