Skip to content

Commit

Permalink
sysutils/coreutils: Fix build with clang 18
Browse files Browse the repository at this point in the history
PR:		277280
Approved by:	maintainer
  • Loading branch information
DimitryAndric authored and lwhsu committed Feb 27, 2024
1 parent 8e49957 commit 45b681e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions sysutils/coreutils/Makefile
@@ -1,5 +1,6 @@
PORTNAME= coreutils
PORTVERSION= 9.4
PORTREVISION= 1
CATEGORIES= sysutils textproc
MASTER_SITES= GNU

Expand Down
24 changes: 24 additions & 0 deletions 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;

0 comments on commit 45b681e

Please sign in to comment.