Date: Mon, 03 Aug 2026 14:30:43 +0000 From: Lexi Winter <ivy@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 78f842dda35b - main - sort: Const correctness for C23 Message-ID: <6a70a613.37031.76e4a9da@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=78f842dda35b7280e8682f90506ff05b591c6b3a commit 78f842dda35b7280e8682f90506ff05b591c6b3a Author: Lexi Winter <ivy@FreeBSD.org> AuthorDate: 2026-08-03 14:06:18 +0000 Commit: Lexi Winter <ivy@FreeBSD.org> CommitDate: 2026-08-03 14:06:18 +0000 sort: Const correctness for C23 On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr() now implements the C23 behaviour where passing a const pointer to strchr() also returns a const pointer. This breaks sort during the bootstrap build, since it assumes the return value is always a mutable pointer. As the returned pointer is never used to modify the value, fix this by making the temporary variable const. MFC after: 1 week Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58491 --- usr.bin/sort/sort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c index 6e4023c43063..422884573ae9 100644 --- a/usr.bin/sort/sort.c +++ b/usr.bin/sort/sort.c @@ -735,7 +735,7 @@ parse_k(const char *s, struct key_specs *ks) { false, false, false, false, false, false }; if (s && *s) { - char *sptr; + const char *sptr; sptr = strchr(s, ','); if (sptr) {home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a70a613.37031.76e4a9da>
