pgsql: Fix 64-bit shifting in dynahash.c

Started by Peter Eisentraut2 months ago1 messagescomitters
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

Fix 64-bit shifting in dynahash.c

The switch from long to int64 in commit 13b935cd521 was incomplete.
It was shifting the constant 1L, which is not always 64 bit. Fix by
using an explicit int64 constant.

MSVC warning:

../src/backend/utils/hash/dynahash.c(1767): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)

Also add the corresponding warning to the standard warning set on
MSVC, to help catch similar issues in the future.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: /messages/by-id/1142ad86-e475-41b3-aeee-c6ad913064fa@eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9018c7d37bb464cd53567c0b553a6f49b50bec78

Modified Files
--------------
meson.build | 4 ++++
src/backend/utils/hash/dynahash.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)