forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6faea01
committed
Change various Gin*Is* macros to return 0/1.
Returning the direct result of bit arithmetic, in a macro intended to beused in a boolean manner, can be problematic if the return value isstored in a variable of type 'bool'. If bool is implemented using C99's_Bool, that can lead to comparison failures if the variable is thencompared again with the expression (see ginStepRight() for an examplethat fails), as _Bool forces the result to be 0/1. That happens in someconfigurations of newer MSVC compilers. It's also problematic whenstoring the result of such an expression in a narrower type.Several gin macros have been declared in that style since gin's initialcommit in8a3631f.There's a lot more macros like this, but this is the only one causingregression test failures; and I don't want to commit and backpatch alarger patch with lots of conflicts just before the next set of minorreleases.Discussion: 20150811154237.GD17575@awork2.anarazel.deBackpatch: All supported branches1 parenta330da4 commit6faea01
1 file changed
+8
-8
lines changedLines changed: 8 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
112 | 112 |
| |
113 | 113 |
| |
114 | 114 |
| |
115 |
| - | |
| 115 | + | |
116 | 116 |
| |
117 | 117 |
| |
118 |
| - | |
| 118 | + | |
119 | 119 |
| |
120 |
| - | |
| 120 | + | |
121 | 121 |
| |
122 |
| - | |
| 122 | + | |
123 | 123 |
| |
124 |
| - | |
| 124 | + | |
125 | 125 |
| |
126 | 126 |
| |
127 |
| - | |
| 127 | + | |
128 | 128 |
| |
129 | 129 |
| |
130 |
| - | |
| 130 | + | |
131 | 131 |
| |
132 | 132 |
| |
133 | 133 |
| |
| |||
224 | 224 |
| |
225 | 225 |
| |
226 | 226 |
| |
227 |
| - | |
| 227 | + | |
228 | 228 |
| |
229 | 229 |
| |
230 | 230 |
| |
|
0 commit comments
Comments
(0)