From: Paul Eggert Date: Wed, 17 Jan 2024 01:21:08 +0000 (-0800) Subject: posixtm: pacify clang 18 X-Git-Tag: v1.0~516 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=67c298c36f69b6906840b7584be06b7b5f33f829;p=gnulib.git posixtm: pacify clang 18 Problem reported by Khem Raj in: https://lists.gnu.org/r/bug-gnulib/2024-01/msg00045.html * lib/posixtm.c (posixtime): Pacify clang 18 by converting bool to int. Arguably this is a bug in draft C2x, since the non-pointer args to ckd_add should promote just like any other expressions do; but that’s not clang’s fault. --- diff --git a/ChangeLog b/ChangeLog index e42d2c31ab..8551538ee8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2024-01-16 Paul Eggert + + posixtm: pacify clang 18 + Problem reported by Khem Raj in: + https://lists.gnu.org/r/bug-gnulib/2024-01/msg00045.html + * lib/posixtm.c (posixtime): Pacify clang 18 by converting bool to int. + Arguably this is a bug in draft C2x, since the non-pointer args to + ckd_add should promote just like any other expressions do; + but that’s not clang’s fault. + 2024-01-07 Jim Meyering update-copyright: handle more cases diff --git a/lib/posixtm.c b/lib/posixtm.c index ef9f55f873..a072c7cad0 100644 --- a/lib/posixtm.c +++ b/lib/posixtm.c @@ -191,7 +191,7 @@ posixtime (time_t *p, const char *s, unsigned int syntax_bits) | (tm0.tm_min ^ tm1.tm_min) | (tm0.tm_sec ^ tm1.tm_sec))) { - if (ckd_add (&t, t, leapsec)) + if (ckd_add (&t, t, +leapsec)) return false; *p = t; return true;