I'm observing a few compiler warnings when building 2026b
with MSVC 19.50.35726:
../pgsql/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
../pgsql/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
This is with a somewhat modified file, but what it's pointing
at is the same in the released 2026b sources:
/* The maximum number of fields on any of the above lines.
(The "+"s pacify gcc -Wenum-compare.) */
enum {
MAX_FIELDS = max(max(+RULE_FIELDS, +LINK_FIELDS),
max(+LEAP_FIELDS, +EXPIRES_FIELDS))
};
Perhaps instead of the "+"s, do explicit casts to int?
../pgsql/src/timezone/zic.c(1654): warning C4146: unary minus operator applied
to unsigned type, result still unsigned
This one is unhappy about
/* The largest uintmax_t that is a multiple of BASE**6. Any random
uintmax_t value that is this value or greater, yields a biased
remainder when divided by BASE**6. UNFAIR_MIN equals the
mathematical value of ((UINTMAX_MAX + 1) - (UINTMAX_MAX + 1) % BASE**6)
computed without overflow. */
uint_fast64_t unfair_min = - ((UINTMAX_MAX % base__6 + 1) % base__6);
Don't immediately have a suggestion about silencing this one.
(This one is showing up on substantially older MSVC versions
than the first two, as far back as MSVC 19.29.30159. I don't
see these warnings on any non-Microsoft compiler.)
regards, tom lane