Re: boolean in C - Mailing list pgsql-hackers

From Tom Lane
Subject Re: boolean in C
Date
Msg-id 6061.1247753871@sss.pgh.pa.us
Whole thread Raw
In response to Re: boolean in C  (Grzegorz Jaskiewicz <gj@pointblue.com.pl>)
Responses Re: boolean in C
List pgsql-hackers
Grzegorz Jaskiewicz <gj@pointblue.com.pl> writes:
> On 16 Jul 2009, at 14:53, Peter Eisentraut wrote:
>>>> the standard does not promise that type _Bool has size = 1 byte.
>>>> We have to have that because of on-disk compatibility requirements.

>>> I think the latter is easily fixable, or forceable to be one byte.

>> How do you plan to do that?

> by casting it to 1 byte type such as char ?

That's hardly going to improve readability for anyone.  Also, it will
flat out not work for the catalog struct declarations.  When we say
"bool relhasindex;" the compiler had better think that that's a
one-byte field.

> And it is pretty annoying, when your product also has its own BOOLean  
> defined...

IOW you're not using stdbool either?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: revised hstore patch
Next
From: Peter Eisentraut
Date:
Subject: Re: Mostly Harmless: c++bookends - patch 2 of 4