public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/libfaketime] f43: Fix build with ISO C23
@ 2026-11-20  7:27 Tomas Korbar
  0 siblings, 0 replies; only message in thread
From: Tomas Korbar @ 2026-11-20  7:27 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/libfaketime
            Branch : f43
            Commit : 5bc6a0f193ec4ecd2109799444a58c4eae10db0b
            Author : Tomas Korbar <tkorbar@redhat.com>
            Date   : 2025-12-15T11:09:58+01:00
            Stats  : +33/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/libfaketime/c/5bc6a0f193ec4ecd2109799444a58c4eae10db0b?branch=f43

            Log:
            Fix build with ISO C23

ISO C23 defines certain string functions as generics, which
return const char * when const char * is used as a argument.
This results in a warning about discarding const qualifier
and with -Werror breaks build.

---
diff --git a/libfaketime-0.9.12-isoc23.patch b/libfaketime-0.9.12-isoc23.patch
new file mode 100644
index 0000000..33654cc
--- /dev/null
+++ b/libfaketime-0.9.12-isoc23.patch
@@ -0,0 +1,30 @@
+commit dbe865dfdba0145d993d70b7fd4ec88b2f47554b
+Author: Tomas Korbar <tkorbar@redhat.com>
+Date:   Mon Dec 15 11:03:21 2025 +0100
+
+    Add const qualifiers to fix build with ISO C23
+    
+    Fix https://github.com/wolfcw/libfaketime/issues/524
+
+diff --git a/src/libfaketime.c b/src/libfaketime.c
+index ef1dca9..02839c8 100644
+--- a/src/libfaketime.c
++++ b/src/libfaketime.c
+@@ -2666,7 +2666,7 @@ int timespec_get(struct timespec *ts, int base)
+ static void parse_ft_string(const char *user_faked_time)
+ {
+   struct tm user_faked_time_tm;
+-  char * tmp_time_fmt;
++  const char * tmp_time_fmt;
+   char * nstime_str;
+ 
+   if (!strncmp(user_faked_time, user_faked_time_saved, BUFFERLEN))
+@@ -3338,7 +3338,7 @@ static void prepare_config_contents(char *contents)
+ bool str_array_contains(const char *haystack, const char *needle)
+ {
+   size_t needle_len = strlen(needle);
+-  char *pos = strstr(haystack, needle);
++  const char *pos = strstr(haystack, needle);
+   while (pos) {
+     if (pos == haystack || *(pos - 1) == ',') {
+       char nextc = *(pos + needle_len);

diff --git a/libfaketime.spec b/libfaketime.spec
index 9cbfbdd..a58f8d5 100644
--- a/libfaketime.spec
+++ b/libfaketime.spec
@@ -17,6 +17,9 @@ BuildRequires:  make
 BuildRequires:  perl-interpreter
 BuildRequires:  perl-Time-HiRes
 
+# https://github.com/wolfcw/libfaketime/pull/525
+Patch0: libfaketime-0.9.12-isoc23.patch
+
 %description
 libfaketime intercepts various system calls that programs use to retrieve the
 current date and time. It then reports modified (faked) dates and times (as

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-20  7:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-20  7:27 [rpms/libfaketime] f43: Fix build with ISO C23 Tomas Korbar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox