]> Savannah Git Hosting - gnulib.git/commitdiff
posixtm: pacify clang 18
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 17 Jan 2024 01:21:08 +0000 (17:21 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 17 Jan 2024 01:22:40 +0000 (17:22 -0800)
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.

ChangeLog
lib/posixtm.c

index e42d2c31abf0513ec3ad1759b130fd307e0571b9..8551538ee8562d0006058b4b7c10adda1a9a26c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-01-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       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  <meyering@meta.com>
 
        update-copyright: handle more cases
index ef9f55f873ee71c63f33dab197d3187b899a5f29..a072c7cad015527ba548766b3bc2d47f67ab984b 100644 (file)
@@ -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;