]> 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)
committerBruno Haible <bruno@clisp.org>
Thu, 18 Jan 2024 08:52:23 +0000 (09:52 +0100)
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 b7d58e6b67b8e2e1ba9f82b50337e124b9814a36..b0ec9900553c22ac28a62fff6ee2b645d79fe0d0 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-15  Bruno Haible  <bruno@clisp.org>
 
        test-framework-sh: Improve portability to native Windows and OS/2.
index 43d65f5975f8e15e475600c25e798fc28fa1a17c..a072c7cad015527ba548766b3bc2d47f67ab984b 100644 (file)
@@ -1,6 +1,6 @@
 /* Parse dates for touch and date.
 
-   Copyright (C) 1989-1991, 1998, 2000-2023 Free Software Foundation, Inc.
+   Copyright (C) 1989-1991, 1998, 2000-2024 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -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;