public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: dev@dpdk.org
Cc: Kevin Traynor <ktraynor@redhat.com>,
	stable@dpdk.org, Radu Nicolau <radu.nicolau@intel.com>,
	Akhil Goyal <gakhil@marvell.com>
Subject: [PATCH] examples/ipsec-secgw: fix discarded-qualifers warnings
Date: Fri, 13 Mar 2026 10:35:23 +0000	[thread overview]
Message-ID: <20260313103523.1094309-1-ktraynor@redhat.com> (raw)

glibc 2.42 has const-preserving functions.

This leads to warnings when there is a const argument
and an assignment to a non-const variable.

Example with GCC 16.0.1 and glibc 2.43 on Fedora Rawhide (F45).

/examples/ipsec-secgw/parser.c: In function ‘parse_ipv4_addr’:
../examples/ipsec-secgw/parser.c:53:13:
warning: assignment discards ‘const’ qualifier from pointer target type
[-Wdiscarded-qualifiers]
   53 |         pch = strchr(token, '/');
      |             ^

Cc: stable@dpdk.org

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
 examples/ipsec-secgw/parser.c | 4 ++--
 examples/ipsec-secgw/sa.c     | 2 +-
 examples/ipsec-secgw/sp4.c    | 2 +-
 examples/ipsec-secgw/sp6.c    | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/examples/ipsec-secgw/parser.c b/examples/ipsec-secgw/parser.c
index cb463c704f..29c4d3cb3d 100644
--- a/examples/ipsec-secgw/parser.c
+++ b/examples/ipsec-secgw/parser.c
@@ -49,5 +49,5 @@ parse_ipv4_addr(const char *token, struct in_addr *ipv4, uint32_t *mask)
 {
 	char ip_str[INET_ADDRSTRLEN] = {0};
-	char *pch;
+	const char *pch;
 
 	pch = strchr(token, '/');
@@ -79,5 +79,5 @@ parse_ipv6_addr(const char *token, struct rte_ipv6_addr *ipv6, uint32_t *mask)
 {
 	char ip_str[256] = {0};
-	char *pch;
+	const char *pch;
 
 	pch = strchr(token, '/');
diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index 86aeb25a49..a1a996dee8 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -1676,5 +1676,5 @@ sa_spi_present(struct sa_ctx *sa_ctx, uint32_t spi, int inbound)
 {
 	uint32_t num;
-	struct ipsec_sa *sa;
+	const struct ipsec_sa *sa;
 	struct ipsec_sa tmpl;
 	const struct ipsec_sa *sar;
diff --git a/examples/ipsec-secgw/sp4.c b/examples/ipsec-secgw/sp4.c
index fc4101a4a2..9c0badd062 100644
--- a/examples/ipsec-secgw/sp4.c
+++ b/examples/ipsec-secgw/sp4.c
@@ -611,5 +611,5 @@ sp4_spi_present(uint32_t spi, int inbound, struct ip_addr ip_addr[2],
 {
 	uint32_t num;
-	struct acl4_rules *rule;
+	const struct acl4_rules *rule;
 	const struct acl4_rules *acr;
 	struct acl4_rules tmpl;
diff --git a/examples/ipsec-secgw/sp6.c b/examples/ipsec-secgw/sp6.c
index ebc47dfe49..8aff843812 100644
--- a/examples/ipsec-secgw/sp6.c
+++ b/examples/ipsec-secgw/sp6.c
@@ -755,5 +755,5 @@ sp6_spi_present(uint32_t spi, int inbound, struct ip_addr ip_addr[2],
 {
 	uint32_t num;
-	struct acl6_rules *rule;
+	const struct acl6_rules *rule;
 	const struct acl6_rules *acr;
 	struct acl6_rules tmpl;
-- 
2.53.0


             reply	other threads:[~2026-03-13 10:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13 10:35 Kevin Traynor [this message]
2026-03-16 10:12 ` [PATCH] examples/ipsec-secgw: fix discarded-qualifers warnings Radu Nicolau
2026-03-17 16:15   ` Thomas Monjalon

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=20260313103523.1094309-1-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=radu.nicolau@intel.com \
    --cc=stable@dpdk.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