public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Tomas Korbar <tkorbar@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/libfaketime] f43: Fix build with ISO C23
Date: Fri, 20 Nov 2026 07:27:52 GMT	[thread overview]
Message-ID: <179515967221.1.2920134469221359570.rpms-libfaketime-5bc6a0f193ec@fedoraproject.org> (raw)

            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

                 reply	other threads:[~2026-11-20  7:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179515967221.1.2920134469221359570.rpms-libfaketime-5bc6a0f193ec@fedoraproject.org \
    --to=tkorbar@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox