Re: boolean in C

From: Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bernd Helmle <mailings(at)oopsware(dot)de>
Subject: Re: boolean in C
Date: 2009-07-16 13:59:22
Message-ID: 55125FC3-5044-421B-821D-ECEAA1ADB8DE@pointblue.com.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 16 Jul 2009, at 14:53, Peter Eisentraut wrote:

> On Thursday 16 July 2009 16:23:31 Grzegorz Jaskiewicz wrote:
>> On 16 Jul 2009, at 14:20, Tom Lane wrote:
>>> Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl> writes:
>>>> oh, another thing.
>>>> stdbool is C99 standard feature.
>>>
>>> We are still targeting C89, not C99.
>>>
>>> Another reason not to depend on stdbool is that, so far as I can
>>> see,
>>> 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 ?
I don't think anyone will add 3rd state to boolean in stdbool, at
least not any time soon :)

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

>
>> Why C89, and not C99 ? Virtually all compilers for last 4 years have/
>> had C99 support.
>
> Well, I think we want to run on systems that are older than 4 years,
> too.

Sure, but that's probably less than 1% of all systems.
The 4 years was a guess, I think its much more than that.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-07-16 14:00:03 Re: Mostly Harmless: c++bookends - patch 2 of 4
Previous Message Peter Eisentraut 2009-07-16 13:53:10 Re: boolean in C