1 From 67c298c36f69b6906840b7584be06b7b5f33f829 Mon Sep 17 00:00:00 2001
2 From: Paul Eggert <eggert@cs.ucla.edu>
3 Date: Tue, 16 Jan 2024 17:21:08 -0800
4 Subject: [PATCH] posixtm: pacify clang 18
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Problem reported by Khem Raj in:
10 https://lists.gnu.org/r/bug-gnulib/2024-01/msg00045.html
11 * lib/posixtm.c (posixtime): Pacify clang 18 by converting bool to int.
12 Arguably this is a bug in draft C2x, since the non-pointer args to
13 ckd_add should promote just like any other expressions do;
14 but that’s not clang’s fault.
16 Upstream-Status: Submitted [https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00046.html]
17 Signed-off-by: Khem Raj <raj.khem@gmail.com>
19 ChangeLog | 10 ++++++++++
21 2 files changed, 11 insertions(+), 1 deletion(-)
23 diff --git a/lib/posixtm.c b/lib/posixtm.c
24 index ef9f55f873..a072c7cad0 100644
27 @@ -191,7 +191,7 @@ posixtime (time_t *p, const char *s, unsigned int syntax_bits)
28 | (tm0.tm_min ^ tm1.tm_min)
29 | (tm0.tm_sec ^ tm1.tm_sec)))
31 - if (ckd_add (&t, t, leapsec))
32 + if (ckd_add (&t, t, +leapsec))