On 2026-07-03 13:09, Tom Lane via tz wrote:
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
...
MAX_FIELDS = max(max(+RULE_FIELDS, +LINK_FIELDS),
...
Perhaps instead of the "+"s, do explicit casts to int?
C casts are too powerful and error-prone, so I'd rather avoid that.
Suppose you change "+" to "0+", or to "- -". Does that pacify MSVC? If
we have to, I suppose we can change it to "1+" and subtract 1 later, but
I hope things don't go that far.
Also, can you send a bug report to the MSVC developers? That warning is
incorrect, as ISO C99 says that +RULE_FIELDS and +LINK_FIELDS are both
of type 'int' even though RULE_FIELDS and LINK_FIELDS themselves are of
enum types.
../pgsql/src/timezone/zic.c(1654): warning C4146: unary minus operator applied
to unsigned type, result still unsigned
...
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.
If it's just an old compiler I would just ignore the warnings. Although
I normally use GCC I don't bother pacifying old GCC versions; life is
too short to worry about bogus warnings from buggy old compilers.