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@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>,
Thomas Munro <thomas.munro@enterprisedb.com>
Date: 2017-12-20T16:02:41Z
Lists: pgsql-hackers
Attachments
- v4-0001-Add-static-assertions-about-size-of-GinNullCatego.patch (text/plain) patch v4-0001
- v4-0002-Add-static-assertions-about-size-of-GinTernaryVal.patch (text/plain) patch v4-0002
- v4-0003-Use-stdbool.h-if-suitable.patch (text/plain) patch v4-0003
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
Commits
-
Use stdbool.h if suitable
- 9a95a77d9d5d 11.0 landed
-
Add configure tests for stdbool.h and sizeof bool
- f20b3285340c 11.0 landed
-
Remove useless use of bit-masking macros
- d91da5ecedc8 11.0 landed
-
Change various Gin*Is* macros to return 0/1.
- af4472bcb88a 9.6.0 cited
-
Fix several possibly non-portable gaffs in record_image_ops.
- 4cbb646334b3 9.4.0 cited