From: Nicholas Vinson <nvinson234@gmail.com>
To: grub-devel@gnu.org, dkiper@net-space.pl
Cc: Nicholas Vinson <nvinson234@gmail.com>
Subject: [PATCH 0/3] C23 string func() handling updates
Date: Fri, 13 Feb 2026 19:18:02 -0500 [thread overview]
Message-ID: <cover.1771026876.git.nvinson234@gmail.com> (raw)
With C23, the following 12 functions were updated to have 'const-aware'
return types:
bsearch(), bsearch_s(), memchr(), strchr(), strpbrk(), strrchr(),
strstr(), wcschr(), wcspbrk(), wcsrchr(), wcsstr(), and wmemchr().
Of these functions, strchr(), strpbrk(), strrchr(), and strstr(), are
used within GRUB, and for 3 of these functions, strchr(), strrchr(), and
strstr(), some of their calls within GRUB are now resulting in
compile-time errors due to the C23 changes and 'discarding qualifier'
errors. The errors are generated by elevating 'discarding qualifier'
warnings to error-level. A promotion GRUB's build system defaults to
doing.
Most of the changes this patch series makes to fix these errors are
simple and only requiring changing a variable's type from 'char *' to
'const char *'. However, the changes in ofpath.c are more involved as
they also update the way lengths are calculated and *printf() functions
are called as a result of these C23 changes.
Furthermore, the changes are needed as C runtime libraries, notably
glbc starting with version 2.43, are implementing the changes the C23
standard requires.
Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
Nicholas Vinson (3):
grub-core/osdep/linux/ofpath.c: Update strstr() calls
util/probe.c: save strrchr() ret val to const data ptr.
util/resolve.c: Save str[r]chr() ret val to const data ptr
grub-core/osdep/linux/ofpath.c | 25 ++++++++++++-------------
util/probe.c | 6 +++---
util/resolve.c | 10 +++++-----
3 files changed, 20 insertions(+), 21 deletions(-)
--
2.53.0
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next reply other threads:[~2026-02-14 0:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-14 0:18 Nicholas Vinson [this message]
2026-02-14 0:18 ` [PATCH 1/3] grub-core/osdep/linux/ofpath.c: Update strstr() calls Nicholas Vinson
2026-02-16 16:54 ` Daniel Kiper
2026-02-23 17:46 ` Nicholas Vinson
2026-02-14 0:18 ` [PATCH 2/3] util/probe.c: save strrchr() ret val to const data ptr Nicholas Vinson
2026-02-16 16:56 ` Daniel Kiper
2026-02-14 0:18 ` [PATCH 3/3] util/resolve.c: Save str[r]chr() " Nicholas Vinson
2026-02-16 16:58 ` Daniel Kiper
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=cover.1771026876.git.nvinson234@gmail.com \
--to=nvinson234@gmail.com \
--cc=dkiper@net-space.pl \
--cc=grub-devel@gnu.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