public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Daiki Ueno <dueno@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/libreswan] f43: Fix compilation error on Fedora 44
Date: Fri, 17 Jul 2026 11:04:06 GMT	[thread overview]
Message-ID: <178428624615.1.390181429008152050.rpms-libreswan-2ba2cf70ce9b@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/libreswan
            Branch : f43
            Commit : 2ba2cf70ce9bdc098c02f13de4eb93c336e4ba94
            Author : Daiki Ueno <dueno@redhat.com>
            Date   : 2026-01-29T13:44:02+09:00
            Stats  : +53/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/libreswan/c/2ba2cf70ce9bdc098c02f13de4eb93c336e4ba94?branch=f43

            Log:
            Fix compilation error on Fedora 44

On Fedora 44, where -Wunused-but-set-variable is enabled with GCC 16,
the build fails with:

  ikev2_proposals.c: In function ‘process_transforms’:
  ikev2_proposals.c:453:46: error: variable ‘local_proposal’ set but not used [-Werror=unused-but-set-variable=]
    453 |                 const struct ikev2_proposal *local_proposal;
        |                                              ^~~~~~~~~~~~~~
  ikev2_proposals.c:773:32: error: variable ‘local_proposal’ set but not used [-Werror=unused-but-set-variable=]
    773 |         struct ikev2_proposal *local_proposal;
        |                                ^~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

Signed-off-by: Daiki Ueno <dueno@redhat.com>

---
diff --git a/libreswan-5.3-unused-but-set-variable.patch b/libreswan-5.3-unused-but-set-variable.patch
new file mode 100644
index 0000000..a37d1ce
--- /dev/null
+++ b/libreswan-5.3-unused-but-set-variable.patch
@@ -0,0 +1,52 @@
+From 75c3bb1663b13fce6cd20d0a160518156de6985a Mon Sep 17 00:00:00 2001
+From: Daiki Ueno <dueno@redhat.com>
+Date: Thu, 29 Jan 2026 11:34:17 +0900
+Subject: [PATCH] Fix compilation error on Fedora 44
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+On Fedora 44, where -Wunused-but-set-variable is enabled with GCC 16,
+the build fails with:
+
+  ikev2_proposals.c: In function ‘process_transforms’:
+  ikev2_proposals.c:453:46: error: variable ‘local_proposal’ set but not used [-Werror=unused-but-set-variable=]
+    453 |                 const struct ikev2_proposal *local_proposal;
+        |                                              ^~~~~~~~~~~~~~
+  ikev2_proposals.c:773:32: error: variable ‘local_proposal’ set but not used [-Werror=unused-but-set-variable=]
+    773 |         struct ikev2_proposal *local_proposal;
+        |                                ^~~~~~~~~~~~~~
+  cc1: all warnings being treated as errors
+
+This fixes it by adding the UNUSED attribute to the local variable.
+
+Signed-off-by: Daiki Ueno <dueno@redhat.com>
+---
+ programs/pluto/ikev2_proposals.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/programs/pluto/ikev2_proposals.c b/programs/pluto/ikev2_proposals.c
+index 6395fa58e2..a10fc37a10 100644
+--- a/programs/pluto/ikev2_proposals.c
++++ b/programs/pluto/ikev2_proposals.c
+@@ -440,7 +440,7 @@ static int process_transforms(struct pbs_in *prop_pbs, struct jambuf *remote_jam
+ 	 */
+ 	{
+ 		int local_propnum;
+-		const struct ikev2_proposal *local_proposal;
++		const struct ikev2_proposal *local_proposal UNUSED;
+ 		FOR_EACH_V2_PROPOSAL_IN_RANGE(local_propnum, local_proposal, local_proposals,
+ 					      local_propnum_base, local_propnum_bound) {
+ 			struct ikev2_proposal_match *matching_local_proposal = &matching_local_proposals[local_propnum];
+@@ -689,7 +689,7 @@ static int process_transforms(struct pbs_in *prop_pbs, struct jambuf *remote_jam
+ 	}
+ 
+ 	int local_propnum;
+-	struct ikev2_proposal *local_proposal;
++	struct ikev2_proposal *local_proposal UNUSED;
+ 	FOR_EACH_V2_PROPOSAL_IN_RANGE(local_propnum, local_proposal, local_proposals,
+ 				      local_propnum_base, local_propnum_bound) {
+ 		struct ikev2_proposal_match *matching_local_proposal = &matching_local_proposals[local_propnum];
+-- 
+2.52.0
+

diff --git a/libreswan.spec b/libreswan.spec
index c64e79b..522df13 100644
--- a/libreswan.spec
+++ b/libreswan.spec
@@ -46,6 +46,7 @@ Source5: https://download.libreswan.org/cavs/ikev2.fax.bz2
 %endif
 
 Patch1: libreswan-4.15-ipsec_import.patch
+Patch2: libreswan-5.3-unused-but-set-variable.patch
 
 BuildRequires: audit-libs-devel
 BuildRequires: bison

                 reply	other threads:[~2026-07-17 11:04 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=178428624615.1.390181429008152050.rpms-libreswan-2ba2cf70ce9b@fedoraproject.org \
    --to=dueno@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