git: 45b681ee03a1 - main - sysutils/coreutils: Fix build with clang 18

From: Li-Wen Hsu <lwhsu_at_FreeBSD.org>
Date: Tue, 27 Feb 2024 05:02:16 UTC
The branch main has been updated by lwhsu:

URL: https://cgit.FreeBSD.org/ports/commit/?id=45b681ee03a1caebb65a89e4772a7afdcbacbf42

commit 45b681ee03a1caebb65a89e4772a7afdcbacbf42
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-02-27 05:01:23 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2024-02-27 05:01:23 +0000

    sysutils/coreutils: Fix build with clang 18
    
    PR:             277280
    Approved by:    maintainer
---
 sysutils/coreutils/Makefile                  |  1 +
 sysutils/coreutils/files/patch-lib_posixtm.c | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/sysutils/coreutils/Makefile b/sysutils/coreutils/Makefile
index a346bdc5e090..9264909a27ab 100644
--- a/sysutils/coreutils/Makefile
+++ b/sysutils/coreutils/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	coreutils
 PORTVERSION=	9.4
+PORTREVISION=	1
 CATEGORIES=	sysutils textproc
 MASTER_SITES=	GNU
 
diff --git a/sysutils/coreutils/files/patch-lib_posixtm.c b/sysutils/coreutils/files/patch-lib_posixtm.c
new file mode 100644
index 000000000000..3265544a82bc
--- /dev/null
+++ b/sysutils/coreutils/files/patch-lib_posixtm.c
@@ -0,0 +1,24 @@
+commit 67c298c36f69b6906840b7584be06b7b5f33f829
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date:   2024-01-16T17:21:08-08:00
+
+    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 thats not clangs fault.
+
+--- lib/posixtm.c.orig	2023-01-01 13:39:11 UTC
++++ lib/posixtm.c
+@@ -191,7 +191,7 @@ posixtime (time_t *p, const char *s, unsigned int synt
+              | (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;