From: Rudi Heitbaum <rudi@heitbaum.com>
To: iwd@lists.linux.dev
Cc: rudi@heitbaum.com
Subject: Bug with iwd-3.11 - const char being modified
Date: Mon, 9 Feb 2026 20:59:33 +0000 [thread overview]
Message-ID: <aYpKtVUTo2QHYCT4@ca26aaf82ac7> (raw)
Bug report (as below) for current iwd (including 3.11) - const char being modified.
When compiling iwd with recent gcc and glibc-2.43 the --Wdiscarded-qualifiers
warning occurs because with ISO C23, the function strrrchr that return
pointers into their input arrays now have definitions as macros that
return a pointer to a const-qualified type when the input argument is
a pointer to a const-qualified type.
../client/known-networks.c: In function 'known_network_proxy_find_by_name':
../client/known-networks.c:296:29: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
296 | char *dot = strrchr(name, '.');
| ^~~~~~~
The fix would be to declare dot as const char as below, but this surfaces
the error that name (which is const) is being modified. See >>>> below -
this being an error.
Regards
Rudi
--- a/client/known-networks.c
+++ b/client/known-networks.c
@@ -293,13 +293,13 @@
network_args.type = NULL;
if (network_args.type) {
- char *dot = strrchr(name, '.');
+ const char *dot = strrchr(name, '.');
if (!dot)
/* This shouldn't ever be the case */
return NULL;
>>>> *dot = '\0';
}
network_args.name = name;
next reply other threads:[~2026-02-09 20:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-09 20:59 Rudi Heitbaum [this message]
2026-02-10 9:34 ` Bug with iwd-3.11 - const char being modified Marcel Holtmann
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=aYpKtVUTo2QHYCT4@ca26aaf82ac7 \
--to=rudi@heitbaum.com \
--cc=iwd@lists.linux.dev \
/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