96c39a9ebc - main - xinstall: Const correctness for C23 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2296c39a9ebc4f081d90b6554d8839e8cde8490a Auto-Submitted: auto-generated Date: Mon, 03 Aug 2026 14:30:45 +0000 Message-Id: <6a70a615.36aaa.46490793@gitrepo.freebsd.org> The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=2296c39a9ebc4f081d90b6554d8839e8cde8490a commit 2296c39a9ebc4f081d90b6554d8839e8cde8490a Author: Lexi Winter AuthorDate: 2026-08-03 14:07:09 +0000 Commit: Lexi Winter CommitDate: 2026-08-03 14:07:09 +0000 xinstall: 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 xinstall 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: ray, markj, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58492 --- usr.bin/xinstall/xinstall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index 7636da20153b..36af3528cae6 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -819,7 +819,8 @@ install(const char *from_name, const char *to_name, u_long fset, u_int flags) char backup[MAXPATHLEN], pathbuf[MAXPATHLEN], tempfile[MAXPATHLEN]; struct stat from_sb, temp_sb, to_sb; struct timespec tsb[2]; - char *digestresult, *p; + char *digestresult; + const char *p; int from_fd, temp_fd, to_fd, serrno; bool devnull, exists, files_match, ispipe, stripped;