public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/libfaketime] epel9: Adapt to GCC 16
Date: Fri, 20 Nov 2026 07:27:43 GMT [thread overview]
Message-ID: <179515966341.1.4414954765196915849.rpms-libfaketime-2e6e05a4aae1@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/libfaketime
Branch : epel9
Commit : 2e6e05a4aae1d262ec4ccfed7e48e669858dfc75
Author : Petr Písař <ppisar@redhat.com>
Date : 2026-01-06T10:40:45+01:00
Stats : +48/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/libfaketime/c/2e6e05a4aae1d262ec4ccfed7e48e669858dfc75?branch=epel9
Log:
Adapt to GCC 16
---
diff --git a/libfaketime-0.9.12-tests-Silence-an-unused-but-set-variable-warning-wit.patch b/libfaketime-0.9.12-tests-Silence-an-unused-but-set-variable-warning-wit.patch
new file mode 100644
index 0000000..c7acac3
--- /dev/null
+++ b/libfaketime-0.9.12-tests-Silence-an-unused-but-set-variable-warning-wit.patch
@@ -0,0 +1,45 @@
+From 712733e5f01e45372f3160cfdbcfd91520cb093d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Tue, 6 Jan 2026 10:18:50 +0100
+Subject: [PATCH] tests: Silence an unused-but-set-variable warning with GCC 16
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Compiling tests with GCC 16 results into this warning:
+
+ gcc -shared -o libmallocintercept.so -fpic -std=gnu99 -Wall -DFAKE_STAT -Werror -Wextra -U_FILE_OFFSET_BITS -U_TIME_BITS libmallocintercept.c
+ libmallocintercept.c: In function ‘free’:
+ libmallocintercept.c:79:12: error: variable ‘ptr2’ set but not used [-Werror=unused-but-set-variable=]
+ 79 | long int ptr2 = (long int) ptr; ptr2 -= (long int) ptr;
+ | ^~~~
+ cc1: all warnings being treated as errors
+
+The ptr2 variable was added in the past to silence compiler warnings,
+probably for the very same reason (commits
+75cbe8e507fa6e83a51e868b2ab9cbd0141c9e55 and
+2bfbe19f719c34f07656cd1513b79209f7d22b61). GCC 16 is smarter and
+discovers that the ptr2 variables is not needed.
+
+This patch changes the work around to "(void) unused_variable;" idiom
+recommended by GCC manual and already used in print_msg().
+---
+ test/libmallocintercept.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/libmallocintercept.c b/test/libmallocintercept.c
+index 61edbb8..845b11c 100644
+--- a/test/libmallocintercept.c
++++ b/test/libmallocintercept.c
+@@ -76,7 +76,7 @@ void *malloc(size_t size) {
+ }
+
+ void free(void *ptr) {
+- long int ptr2 = (long int) ptr; ptr2 -= (long int) ptr;
++ (void) ptr; /* unused */
+ print_msg("Called free() on from libmallocintercept...");
+ poke_faketime();
+ print_msg("successfully\n");
+--
+2.52.0
+
diff --git a/libfaketime.spec b/libfaketime.spec
index cfef608..ba5f51f 100644
--- a/libfaketime.spec
+++ b/libfaketime.spec
@@ -25,6 +25,9 @@ Patch0: libfaketime-0.9.12-isoc23.patch
# Make the libraires executable, needed for stripping them. Not suitable for
# upstream, e.g. Debian does not like it.
Patch1: libfaketime-0.9.12-Dynamic-libraries-are-expected-to-be-executable-on-F.patch
+# Adapt to GCC 16, posted upstream,
+# <https://github.com/wolfcw/libfaketime/pull/528>
+Patch2: libfaketime-0.9.12-tests-Silence-an-unused-but-set-variable-warning-wit.patch
BuildRequires: coreutils
BuildRequires: gcc
BuildRequires: make
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=179515966341.1.4414954765196915849.rpms-libfaketime-2e6e05a4aae1@fedoraproject.org \
--to=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