mirror of
https://github.com/postgres/postgres.git
synced 2025-11-24 00:23:06 +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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user