From: Rudi Heitbaum <rudi@heitbaum.com>
To: wireguard@lists.zx2c4.com
Cc: rudi@heitbaum.com
Subject: [PATCH] wireguard-tools: retain const qualifier from pointer
Date: Sat, 7 Feb 2026 05:12:27 +0000 [thread overview]
Message-ID: <aYbJJ86gqdWvmD-j@c9fca329e4d7> (raw)
Since glibc-2.43:
For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return pointers
into their input arrays now have definitions as macros that return a
pointer to a const-qualified type when the in put argument is a pointer
to a const-qualified type.
https://lists.gnu.org/archive/html/info-gnu/2026-01/msg00005.html
Resolves the following warning:
config.c: In function 'config_read_line':
config.c:513:17: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
513 | comment = strchr(input, COMMENT_CHAR);
| ^
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
---
src/config.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/config.c b/src/config.c
index 6b8aa58..cd65d7e 100644
--- a/src/config.c
+++ b/src/config.c
@@ -506,7 +506,8 @@ error:
bool config_read_line(struct config_ctx *ctx, const char *input)
{
size_t len, cleaned_len = 0;
- char *line, *comment;
+ const char *comment;
+ char *line;
bool ret = true;
/* This is what strchrnul is for, but that isn't portable. */
--
2.51.0
reply other threads:[~2026-02-08 18:50 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=aYbJJ86gqdWvmD-j@c9fca329e4d7 \
--to=rudi@heitbaum.com \
--cc=wireguard@lists.zx2c4.com \
/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