Re: [HACKERS] taking stdbool.h into use
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Michael Paquier <michael.paquier@gmail.com>,
Alvaro Herrera <alvherre@alvh.no-ip.org>,
pgsql-hackers <pgsql-hackers@postgresql.org>,
Thomas Munro <thomas.munro@enterprisedb.com>,
Kevin Grittner <kgrittn@gmail.com>
Date: 2018-01-11T23:40:05Z
Lists: pgsql-hackers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes: > That leaves the uses in rowtypes.c. Those were introduced as a > portability fix by commit 4cbb646334b. I'm curious why these are > necessary. The Datums they operate come from heap_deform_tuple(), which > gets them from fetchatt(), which does run all pass-by-value values > through the very same GET_X_BYTES() macros (until now). I don't see > where those dirty upper bits would be coming from. I don't see it either. I think the actually useful parts of that patch were to declare record_image_cmp's result correctly as int rather than bool, and to cope with varlena fields of unequal size. Unfortunately there seems to be no contemporaneous mailing list discussion, so it's not clear what Kevin based this change on. Want to try reverting the GET_X_BYTES() parts of it and see if the buildfarm complains? Note if that if we simplify the GetDatum macros, it's possible that record_image_cmp would change behavior, since it might now see signed not unsigned values depending on whether the casts do sign extension or not. Not sure if that'd be a problem. regards, tom lane
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