On Tue, Mar 13, 2018 at 03:25:39PM -0400, Peter Eisentraut wrote: > 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.
So, on one side of the ring, we have more complicated patches to include so as support for sizeof(bool) == 4 becomes possible in the backend code, and on the opposite side one patch which restrains the use of stdbool.h only when the size is 1. A size of 4 bytes for bool is defined in stdbool.h on a small set of platforms, so it could be tempting to use what is proposed here, still that feels like a halk-baked integration. Thoughts from others? -- Michael
signature.asc
Description: PGP signature