pgsql: Fix MSVC warnings from new timezone code

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix MSVC warnings from new timezone code
Date: 2026-08-05 18:10:24
Message-ID: E1wrg4O-00000000KWm-2MCR@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://www.postgresql.org/message-id/flat/2294297.1780270682%40sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0d8e41fe1c80d1310e0eed0f66af82f60e506c69

Modified Files
--------------
src/timezone/zic.c | 11 +++++++++++
1 file changed, 11 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2026-08-05 18:50:38 pgsql: Remove Subscription conninfo field; generate in caller.
Previous Message Melanie Plageman 2026-08-05 15:44:52 pgsql: Make local buffers pin limit more conservative