diff options
author | Tom Lane | 2018-06-17 20:15:11 +0000 |
---|---|---|
committer | Tom Lane | 2018-06-17 20:15:11 +0000 |
commit | 9b53d966847c55fbd2bff63b3e1a1c37fc694071 (patch) | |
tree | 0347b58db1ab9598307ddf3c9e207ce1aa90514e /src/backend/utils/adt/network.c | |
parent | 514d4a1338d5409431d644eaf453193ac362ef16 (diff) |
Suppress -Wshift-negative-value warnings.
Clean up four places that result in compiler warnings when using recent
gcc with this warning class enabled (as seen on buildfarm members
calliphoridae, skink, and others). In all these places, this is purely
cosmetic, because the shift distance could not be large enough to risk
a change of sign, so there's no chance of implementation-dependent
behavior. Still, it's easy enough to avoid the warning by casting the
shifted value to unsigned, so let's do that.
Patch HEAD only, this isn't worth a back-patch.
Diffstat (limited to 'src/backend/utils/adt/network.c')
-rw-r--r-- | src/backend/utils/adt/network.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/network.c b/src/backend/utils/adt/network.c index 350b1a63d21..5af7f4e0468 100644 --- a/src/backend/utils/adt/network.c +++ b/src/backend/utils/adt/network.c @@ -1486,7 +1486,7 @@ inetmi(PG_FUNCTION_ARGS) * have to do proper sign extension. */ if (carry == 0 && byte < sizeof(int64)) - res |= ((int64) -1) << (byte * 8); + res |= ((uint64) (int64) -1) << (byte * 8); } PG_RETURN_INT64(res); |