Re: [HACKERS] taking stdbool.h into use

Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Michael Paquier <michael@paquier.xyz>, Andres Freund <andres@anarazel.de>
Cc: Michael Paquier <michael.paquier@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Alvaro Herrera <alvherre@alvh.no-ip.org>, pgsql-hackers <pgsql-hackers@postgresql.org>, Thomas Munro <thomas.munro@enterprisedb.com>
Date: 2018-03-13T19:25:39Z
Lists: pgsql-hackers

Attachments

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

Commits

  1. Use stdbool.h if suitable

  2. Add configure tests for stdbool.h and sizeof bool

  3. Remove useless use of bit-masking macros

  4. Change various Gin*Is* macros to return 0/1.

  5. Fix several possibly non-portable gaffs in record_image_ops.