From: Bernd Kuhls <bernd@kuhls.net>
To: buildroot@buildroot.org
Cc: Alexander Clouter <alex+buildroot@digriz.org.uk>
Subject: [Buildroot] [PATCH 1/1] package/odhcp6c: fix build with glibc >= 2.43
Date: Thu, 9 Apr 2026 10:23:42 +0200 [thread overview]
Message-ID: <20260409082342.3957780-1-bernd@kuhls.net> (raw)
Buildroot commit 227378b5930b681c79a13476ae60a98753a98a03 bumped glibc
to 2.43 causing build errors in odhcp6c like:
/home/autobuild/autobuild/instance-10/output-1/build/odhcp6c-f19dd37fb467c9cf10cad57aefa0d048312d7dfd/src/config.c:
In function 'config_parse_opt_string':
/home/autobuild/autobuild/instance-10/output-1/build/odhcp6c-f19dd37fb467c9cf10cad57aefa0d048312d7dfd/src/config.c:338:21:
error: initialization discards 'const' qualifier from pointer target
type [-Werror=discarded-qualifiers]
338 | char *sep = strpbrk(src, ARRAY_SEP);
Add upstream commit to fix the problem.
Fixes:
https://autobuild.buildroot.net/results/efb/efb43d2dc069f5ba9c56816d670a8a2a3682d9ae/
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
...p6c-const-cast-for-c23-compatibility.patch | 102 ++++++++++++++++++
1 file changed, 102 insertions(+)
create mode 100644 package/odhcp6c/0001-odhcp6c-const-cast-for-c23-compatibility.patch
diff --git a/package/odhcp6c/0001-odhcp6c-const-cast-for-c23-compatibility.patch b/package/odhcp6c/0001-odhcp6c-const-cast-for-c23-compatibility.patch
new file mode 100644
index 0000000000..cdb26a7434
--- /dev/null
+++ b/package/odhcp6c/0001-odhcp6c-const-cast-for-c23-compatibility.patch
@@ -0,0 +1,102 @@
+From 3b69378125aba61b3391bf5fe607983ce75b839c Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Wed, 8 Apr 2026 14:14:56 -0700
+Subject: [PATCH] odhcp6c: const cast for c23 compatibility
+
+strpbrk is now a macro that returns const based on the parameter. Cast
+it away when we don't want const.
+
+Signed-off-by: Rosen Penev <rosenp@gmail.com>
+
+Upstream: https://github.com/openwrt/odhcp6c/pull/156
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ src/config.c | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/src/config.c b/src/config.c
+index 54e2d35..c1a3a99 100644
+--- a/src/config.c
++++ b/src/config.c
+@@ -338,7 +338,7 @@ static int config_parse_opt_u8(const char *src, uint8_t **dst)
+ static int config_parse_opt_string(const char *src, uint8_t **dst, const bool array)
+ {
+ int o_len = 0;
+- char *sep = strpbrk(src, ARRAY_SEP);
++ char *sep = strpbrk((char*)src, ARRAY_SEP);
+
+ if (sep && !array)
+ return -1;
+@@ -362,7 +362,7 @@ static int config_parse_opt_string(const char *src, uint8_t **dst, const bool ar
+ src = sep;
+
+ if (sep)
+- sep = strpbrk(src, ARRAY_SEP);
++ sep = strpbrk((char*)src, ARRAY_SEP);
+ } while (src);
+
+ return o_len;
+@@ -371,7 +371,7 @@ static int config_parse_opt_string(const char *src, uint8_t **dst, const bool ar
+ static int config_parse_opt_dns_string(const char *src, uint8_t **dst, const bool array)
+ {
+ int o_len = 0;
+- char *sep = strpbrk(src, ARRAY_SEP);
++ char *sep = strpbrk((char*)src, ARRAY_SEP);
+
+ if (sep && !array)
+ return -1;
+@@ -399,7 +399,7 @@ static int config_parse_opt_dns_string(const char *src, uint8_t **dst, const boo
+ src = sep;
+
+ if (sep)
+- sep = strpbrk(src, ARRAY_SEP);
++ sep = strpbrk((char*)src, ARRAY_SEP);
+ } while (src);
+
+ return o_len;
+@@ -408,7 +408,7 @@ static int config_parse_opt_dns_string(const char *src, uint8_t **dst, const boo
+ static int config_parse_opt_ip6(const char *src, uint8_t **dst, const bool array)
+ {
+ int o_len = 0;
+- char *sep = strpbrk(src, ARRAY_SEP);
++ char *sep = strpbrk((char*)src, ARRAY_SEP);
+
+ if (sep && !array)
+ return -1;
+@@ -433,7 +433,7 @@ static int config_parse_opt_ip6(const char *src, uint8_t **dst, const bool array
+ src = sep;
+
+ if (sep)
+- sep = strpbrk(src, ARRAY_SEP);
++ sep = strpbrk((char*)src, ARRAY_SEP);
+ } while (src);
+
+ return o_len;
+@@ -442,7 +442,7 @@ static int config_parse_opt_ip6(const char *src, uint8_t **dst, const bool array
+ static int config_parse_opt_user_class(const char *src, uint8_t **dst, const bool array)
+ {
+ int o_len = 0;
+- char *sep = strpbrk(src, ARRAY_SEP);
++ char *sep = strpbrk((char*)src, ARRAY_SEP);
+
+ if (sep && !array)
+ return -1;
+@@ -471,7 +471,7 @@ static int config_parse_opt_user_class(const char *src, uint8_t **dst, const boo
+ src = sep;
+
+ if (sep)
+- sep = strpbrk(src, ARRAY_SEP);
++ sep = strpbrk((char*)src, ARRAY_SEP);
+ } while (src);
+
+ return o_len;
+@@ -555,7 +555,7 @@ int config_parse_opt(const char *opt)
+ struct odhcp6c_opt *dopt = NULL;
+ int ret = -1;
+
+- data = strpbrk(opt, ":");
++ data = strpbrk((char*)opt, ":");
+ if (!data)
+ return -1;
+
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
reply other threads:[~2026-04-09 8:23 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=20260409082342.3957780-1-bernd@kuhls.net \
--to=bernd@kuhls.net \
--cc=alex+buildroot@digriz.org.uk \
--cc=buildroot@buildroot.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