[openwrt/openwrt] tools/gnulib: add patch to fix build on macos

LEDE Commits lede-commits at lists.infradead.org
Sat Feb 7 09:16:38 PST 2026


hauke pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/d36411269cfea3fe8ba99e25ea280e4efc2fdfd2

commit d36411269cfea3fe8ba99e25ea280e4efc2fdfd2
Author: Martin Schiller <ms at dev.tdt.de>
AuthorDate: Thu Dec 11 07:48:37 2025 +0100

    tools/gnulib: add patch to fix build on macos
    
    This backports a fix for lib/posixtm.c.
    
    Signed-off-by: Martin Schiller <ms at dev.tdt.de>
    Link: https://github.com/openwrt/openwrt/pull/21040
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../patches/001-posixtm-pacify-clang-18.patch      | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/tools/gnulib/patches/001-posixtm-pacify-clang-18.patch b/tools/gnulib/patches/001-posixtm-pacify-clang-18.patch
new file mode 100644
index 0000000000..580c07a567
--- /dev/null
+++ b/tools/gnulib/patches/001-posixtm-pacify-clang-18.patch
@@ -0,0 +1,46 @@
+From 67c298c36f69b6906840b7584be06b7b5f33f829 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert at cs.ucla.edu>
+Date: Tue, 16 Jan 2024 17:21:08 -0800
+Subject: [PATCH] posixtm: pacify clang 18
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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     | 10 ++++++++++
+ lib/posixtm.c |  2 +-
+ 2 files changed, 11 insertions(+), 1 deletion(-)
+
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,13 @@
++2024-01-16  Paul Eggert  <eggert at 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.
++
+ 2023-03-23  Bruno Haible  <bruno at clisp.org>
+ 
+ 	printf-posix tests: Fix compilation error (regression 2021-08-28).
+--- a/lib/posixtm.c
++++ b/lib/posixtm.c
+@@ -191,7 +191,7 @@ posixtime (time_t *p, const char *s, uns
+              | (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;




More information about the lede-commits mailing list