Re: gboolean definition and size



On Wed, Sep 12, 2001 at 03:49:25PM -0700, Dan Nicolaescu wrote:
> Hi!
> 
> gboolean is currently defined as an int. 
> 
> The C99 standard contains now a standard boolean size, and it's _not_
> int size.

Yes, just like in C++.

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

Exactly why it shouldn't be changed at all, IMHO. glib would work with
everything, including C89, C99, and C++. Using datatypes that vary in
size among these is an invitation for disaster, especially if
different compilers on the same system can give it a different size!

If you're concerned about space usage, why not just define it to be
char? Not necessarily a good idea, however, because on many
architectures, using types smaller than a certain size can result in
slower code. int is usually of this size.

-- 
THE FBI IS INVESTIGATING USERS AT MY ISP. If I do or say something
unusual, the message was probably forged. ALL MY AUTHENTIC MESSAGES
ARE PGP/GPG SIGNED/ENCRYPTED. Send nothing to me unencrypted. Public
key can be found at http://truffula.net/~quotemaster/key.txt

Attachment: pgpF9RwdAw1r4.pgp
Description: PGP signature



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