Fix MSVC warnings from new timezone code
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 5 Aug 2026 17:26:30 +0000 (19:26 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 5 Aug 2026 18:05:28 +0000 (20:05 +0200)
commit0d8e41fe1c80d1310e0eed0f66af82f60e506c69
tree6692e6599998508a5236e4087ce3b0f07a0460a5
parentfd2b89854d93d70fe8c9a69d5b8fafd5b9302cfc
Fix MSVC warnings from new timezone code

The new timezone code from commit aeb07c55fab introduced a few new
compiler warnings from MSVC:

    ../src/timezone/zic.c(353): warning C5287: operands are different enum types '<unnamed-enum-RF_NAME>' and '<unnamed-enum-LF_TARGET>'; use an explicit cast to silence this warning
    ../src/timezone/zic.c(353): warning C5287: operands are different enum types '<unnamed-enum-RF_NAME>' and '<unnamed-enum-LP_YEAR>'; use an explicit cast to silence this warning
    ../src/timezone/zic.c(1654): warning C4146: unary minus operator applied to unsigned type, result still unsigned

Silence these warnings with pragmas.

In order not to make future code merges more complicated, the pragmas
apply to the entire file, not only to the specific code sections where
they are needed.  This also prevents further warnings of the same
kinds creeping in.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/2294297.1780270682%40sss.pgh.pa.us
src/timezone/zic.c