Re: [HACKERS] taking stdbool.h into use

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Andres Freund <andres(at)anarazel(dot)de>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, 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: 2018-03-13 19:25:39
Message-ID: ddb90046-364a-94f1-893c-7bec8c931ae7@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/1/18 23:34, Michael Paquier wrote:
> Indeed, this is wrong. Peter, why did you switch suddendly this patch
> as ready for committer? The patch is waiting for your input as you
> mentioned that the GIN portion of this patch series is not completely
> baked yet. So I have switched the patch in this state.

After more digging, there are more problems with having a bool that is
not 1 byte. For example, pg_control has a bool field, so with a
different bool size, pg_control would be laid out differently. That
would require changing all the mentions of bool to bool8 where the end
up on disk somehow, as I had already done for the system catalog
structures, but we don't know all the other places that would be affected.

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.

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

Attachment Content-Type Size
v6-0001-Add-static-assertions-about-size-of-GinTernaryVal.patch text/plain 1.6 KB
v6-0002-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 Laurenz Albe 2018-03-13 19:27:20 Re: [submit code] I develop a tool for pgsql, how can I submit it
Previous Message Tom Lane 2018-03-13 19:12:59 Re: JIT compiling with LLVM v11