* [PATCH] examples/ipsec-secgw: fix discarded-qualifers warnings
@ 2026-03-13 10:35 Kevin Traynor
2026-03-16 10:12 ` Radu Nicolau
0 siblings, 1 reply; 3+ messages in thread
From: Kevin Traynor @ 2026-03-13 10:35 UTC (permalink / raw)
To: dev; +Cc: Kevin Traynor, stable, Radu Nicolau, Akhil Goyal
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] examples/ipsec-secgw: fix discarded-qualifers warnings
2026-03-13 10:35 [PATCH] examples/ipsec-secgw: fix discarded-qualifers warnings Kevin Traynor
@ 2026-03-16 10:12 ` Radu Nicolau
2026-03-17 16:15 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Radu Nicolau @ 2026-03-16 10:12 UTC (permalink / raw)
To: Kevin Traynor, dev; +Cc: stable, Akhil Goyal
On 13-Mar-26 10:35 AM, Kevin Traynor wrote:
> 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>
> ---
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] examples/ipsec-secgw: fix discarded-qualifers warnings
2026-03-16 10:12 ` Radu Nicolau
@ 2026-03-17 16:15 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2026-03-17 16:15 UTC (permalink / raw)
To: Kevin Traynor; +Cc: dev, stable, Akhil Goyal, Radu Nicolau
16/03/2026 11:12, Radu Nicolau:
>
> On 13-Mar-26 10:35 AM, Kevin Traynor wrote:
> > glibc 2.42 has const-preserving functions.
It is in glibc 2.43.
> >
> > 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>
> > ---
> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-17 16:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-13 10:35 [PATCH] examples/ipsec-secgw: fix discarded-qualifers warnings Kevin Traynor
2026-03-16 10:12 ` Radu Nicolau
2026-03-17 16:15 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox