commit:     941cbe454bc58735a04ac0bbcc83167cd9fd8aa8
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 24 05:57:18 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar 24 05:57:18 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=941cbe45

sys-apps/coreutils: backport Clang 18 patch

Closes: https://bugs.gentoo.org/926349
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-apps/coreutils/coreutils-9.4-r1.ebuild         |  1 +
 ...reutils-9.4-gnulib-clang-18-c23-stdckdint.patch | 30 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/sys-apps/coreutils/coreutils-9.4-r1.ebuild 
b/sys-apps/coreutils/coreutils-9.4-r1.ebuild
index 9ed86c076690..adf51c2bed02 100644
--- a/sys-apps/coreutils/coreutils-9.4-r1.ebuild
+++ b/sys-apps/coreutils/coreutils-9.4-r1.ebuild
@@ -118,6 +118,7 @@ src_prepare() {
                # Upstream patches
                "${FILESDIR}"/${P}-gnulib-openssl-1.1.patch
                "${FILESDIR}"/${P}-CVE-2024-0684.patch
+               "${FILESDIR}"/${P}-gnulib-clang-18-c23-stdckdint.patch
        )
 
        if ! use vanilla && [[ -d "${WORKDIR}"/${MY_PATCH} ]] ; then

diff --git 
a/sys-apps/coreutils/files/coreutils-9.4-gnulib-clang-18-c23-stdckdint.patch 
b/sys-apps/coreutils/files/coreutils-9.4-gnulib-clang-18-c23-stdckdint.patch
new file mode 100644
index 000000000000..44982a17a78c
--- /dev/null
+++ b/sys-apps/coreutils/files/coreutils-9.4-gnulib-clang-18-c23-stdckdint.patch
@@ -0,0 +1,30 @@
+https://bugs.gentoo.org/926349
+https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commit;h=67c298c36f6
+
+From 67c298c36f69b6906840b7584be06b7b5f33f829 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <[email protected]>
+Date: Tue, 16 Jan 2024 17:21:08 -0800
+Subject: [PATCH] posixtm: pacify clang 18
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+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.
+--- 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;
+-- 
+2.17.1

Reply via email to