From daf36e0df73a817cbe84f0083b89ac4d6868a935 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sat, 11 Jul 2026 13:56:51 +0200 Subject: [PATCH 1/3] 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 '' and ''; use an explicit cast to silence this warning ../src/timezone/zic.c(353): warning C5287: operands are different enum types '' and ''; 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. --- src/timezone/zic.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/timezone/zic.c b/src/timezone/zic.c index 1f89e220730..38411220e01 100644 --- a/src/timezone/zic.c +++ b/src/timezone/zic.c @@ -350,8 +350,15 @@ enum */ enum { +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 5287) +#endif MAX_FIELDS = max(max(+RULE_FIELDS, +LINK_FIELDS), max(+LEAP_FIELDS, +EXPIRES_FIELDS)) +#ifdef _MSC_VER +#pragma warning(pop) +#endif }; /* @@ -1651,7 +1658,14 @@ random_dirent(char const **name, char **namealloc) * value of ((UINTMAX_MAX + 1) - (UINTMAX_MAX + 1) % BASE**6) computed * without overflow. */ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4146) +#endif uint_fast64_t unfair_min = -((UINTMAX_MAX % base__6 + 1) % base__6); +#ifdef _MSC_VER +#pragma warning(pop) +#endif if (!dst) { -- 2.55.0