From 23fbada0c1481d7e135a7885920c6ac5a548a2fa Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 4 Jul 2026 11:02:15 -0700
Subject: [DRAFT 1/2] Pacify MSVC when comparing enums

Problem reported by Tom Lane for MSVC 19.50.35726 in:
https://lists.iana.org/hyperkitty/list/tz@iana.org/thread/PJBVERYHQZEXIREYIHC5OJGZMNVQC2SD/
* zic.c (MAX_FIELDS): Pacify with ~~ instead of with +.
---
 zic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/zic.c b/zic.c
index af2bb80a..e049303d 100644
--- a/zic.c
+++ b/zic.c
@@ -412,10 +412,10 @@ enum {
 };
 
 /* The maximum number of fields on any of the above lines.
-   (The "+"s pacify gcc -Wenum-compare.)  */
+   (The "~~"s pacify gcc -Wenum-compare and MSVC C5287.)  */
 enum {
-  MAX_FIELDS = max(max(+RULE_FIELDS, +LINK_FIELDS),
-		   max(+LEAP_FIELDS, +EXPIRES_FIELDS))
+  MAX_FIELDS = max(max(~~RULE_FIELDS, ~~LINK_FIELDS),
+		   max(~~LEAP_FIELDS, ~~EXPIRES_FIELDS))
 };
 
 /*
-- 
2.53.0

