Re: [HACKERS] taking stdbool.h into use

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Subject: Re: [HACKERS] taking stdbool.h into use
Date: 2017-12-20 16:02:41
Message-ID: 396512c3-4349-f356-679a-a231093c5c37@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/15/17 15:13, Peter Eisentraut wrote:
> I'm going to put this patch set as Returned With Feedback for now. The
> GinNullCategory issues look like they will need quite a bit of work.
> But it will be worth picking this up some time.

I think the issue with GinNullCategory is practically unfixable. This
is on-disk data that needs to be castable to an array of bool. So
tolerating a bool of size other than 1 would either require a disk
format change or extensive code changes, neither of which seem
worthwhile at this point.

So here is a minimal patch set to perhaps wrap this up for the time
being. I have added static assertions that check the sizes of
GinNullCategory and GinTernaryValue, which I think are the two critical
places that require compatibility with bool. And then we include
<stdbool.h> only if its bool has size 1.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
v4-0001-Add-static-assertions-about-size-of-GinNullCatego.patch text/plain 2.2 KB
v4-0002-Add-static-assertions-about-size-of-GinTernaryVal.patch text/plain 1.6 KB
v4-0003-Use-stdbool.h-if-suitable.patch text/plain 13.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2017-12-20 16:04:02 Re: AS OF queries
Previous Message Tom Lane 2017-12-20 15:51:15 Re: [HACKERS] static assertions in C++