mirror of
https://github.com/postgres/postgres.git
synced 2025-11-19 13:42:17 +03:00
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.
This commit is contained in:
@@ -202,7 +202,7 @@ inet_cidr_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size)
|
||||
b = bits % 8;
|
||||
if (b != 0)
|
||||
{
|
||||
m = ~0 << (8 - b);
|
||||
m = ((u_int) ~0) << (8 - b);
|
||||
inbuf[p - 1] &= m;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user