Re: [HACKERS] taking stdbool.h into use - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] taking stdbool.h into use
Date
Msg-id 21392.1521526734@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] taking stdbool.h into use  (Michael Paquier <michael@paquier.xyz>)
Responses Re: [HACKERS] taking stdbool.h into use  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Tue, Mar 13, 2018 at 03:25:39PM -0400, Peter Eisentraut wrote:
>> So I'm going back to my proposal from December, to just use stdbool.h
>> when sizeof(bool) == 1, and add a static assertion to prevent other
>> configurations.

> So, on one side of the ring, we have more complicated patches to include
> so as support for sizeof(bool) == 4 becomes possible in the backend
> code, and on the opposite side one patch which restrains the use of
> stdbool.h only when the size is 1.  A size of 4 bytes for bool is
> defined in stdbool.h on a small set of platforms, so it could be
> tempting to use what is proposed here, still that feels like a
> halk-baked integration.  Thoughts from others?

I think it'd be worth identifying exactly which platforms have
sizeof(bool) different from 1.  Are any of them things that anyone
cares about going forward?  The point of this patch is to ease
future development of extensions, but it's unlikely any extension
authors care about portability onto, say, macOS 10.4 (prairiedog).

            regards, tom lane


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] taking stdbool.h into use
Next
From: Dilip Kumar
Date:
Subject: Re: Problem while setting the fpw with SIGHUP