summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2016-04-02 17:49:17 +0000
committerTom Lane2016-04-02 17:49:17 +0000
commit45aae8e78967b37f285e99617b919319bf2bf536 (patch)
treef85fb7bb19c4d8c48fce58ee5c15aa455e85d83c
parent9c50372d20aabdb23963f8d28651728d546acefb (diff)
Suppress compiler warning.
Some buildfarm members are showing "comparison is always false due to limited range of data type" complaints on this test, so #ifdef it out on machines with 32-bit int.
-rw-r--r--src/timezone/zic.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/timezone/zic.c b/src/timezone/zic.c
index f5b7ddf92c..b546a17372 100644
--- a/src/timezone/zic.c
+++ b/src/timezone/zic.c
@@ -1179,11 +1179,14 @@ gethms(char const * string, char const * errstring, bool signable)
error("%s", errstring);
return 0;
}
- if (ZIC_MAX / SECSPERHOUR < (zic_t) hh)
+ /* Some compilers warn that this test is unsatisfiable for 32-bit ints */
+#if INT_MAX > PG_INT32_MAX
+ if (ZIC_MAX / SECSPERHOUR < hh)
{
error(_("time overflow"));
return 0;
}
+#endif
if (noise && (hh > HOURSPERDAY ||
(hh == HOURSPERDAY && (mm != 0 || ss != 0))))
warning(_("values over 24 hours not handled by pre-2007 versions of zic"));