forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit65a8a3f
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 parent8ea71fd commit65a8a3f
1 file changed
+5
-5
lines changedLines changed: 5 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
106 | 106 |
| |
107 | 107 |
| |
108 | 108 |
| |
109 |
| - | |
| 109 | + | |
110 | 110 |
| |
111 | 111 |
| |
112 |
| - | |
| 112 | + | |
113 | 113 |
| |
114 |
| - | |
| 114 | + | |
115 | 115 |
| |
116 |
| - | |
| 116 | + | |
117 | 117 |
| |
118 | 118 |
| |
119 |
| - | |
| 119 | + | |
120 | 120 |
| |
121 | 121 |
| |
122 | 122 |
| |
|
0 commit comments
Comments
(0)