diff options
author | Andres Freund <andres@anarazel.de> | 2016-03-27 17:47:46 +0200 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2016-03-27 17:47:46 +0200 |
commit | 598e2c55ebbbb292c4f79c4acdc8567bf18ef9be (patch) | |
tree | 099ef0b48d0a85c9263871b52a871ad62f04ad76 /src/backend/access/gist/gistxlog.c | |
parent | 528f112b049b22c72f1d16f22754585254d6115b (diff) | |
download | postgresql-598e2c55ebbbb292c4f79c4acdc8567bf18ef9be.tar.gz postgresql-598e2c55ebbbb292c4f79c4acdc8567bf18ef9be.zip |
Change various Gin*Is* macros to return 0/1.
Returning the direct result of bit arithmetic, in a macro intended to be
used in a boolean manner, can be problematic if the return value is
stored in a variable of type 'bool'. If bool is implemented using C99's
_Bool, that can lead to comparison failures if the variable is then
compared again with the expression (see ginStepRight() for an example
that fails), as _Bool forces the result to be 0/1. That happens in some
configurations of newer MSVC compilers. It's also problematic when
storing the result of such an expression in a narrower type.
Several gin macros have been declared in that style since gin's initial
commit in 8a3631f8d86.
There's a lot more macros like this, but this is the only one causing
regression test failures; and I don't want to commit and backpatch a
larger patch with lots of conflicts just before the next set of minor
releases.
Discussion: 20150811154237.GD17575@awork2.anarazel.de
Backpatch: All supported branches
Diffstat (limited to 'src/backend/access/gist/gistxlog.c')
0 files changed, 0 insertions, 0 deletions