gboolean definition and size



Hi!

gboolean is currently defined as an int. 

The C99 standard contains now a standard boolean size, and it's _not_
int size. 

gcc-3.x defines a magic type _Bool that is used to define the bool
type. It's size is 1 byte.

Is there any reason for gboolean to have a different size? 

IMHO it should be defined in such a way that it makes interoperability
with C99 code easy. 

Probably gboolean should be defined as _Bool when using gcc-3.x 
Another reason is that in the future compilers might have
special optimizations for bool types... 

As changing the definition of gboolean is a binary incompatible
change, it's probably a good idea to do it before releasing gtk-2.0 ...


I tried to search the mailing list archive, and didn't find any
discussion of this, I hope it has not been beaten to death in the
past... 

        --dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]