Page MenuHomeFreeBSD

xinstall: Const correctness for C23
ClosedPublic

Authored by ivy on Jul 27 2026, 10:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 11, 6:41 PM
Unknown Object (File)
Sun, Oct 11, 5:49 AM
Unknown Object (File)
Fri, Oct 9, 4:05 PM
Unknown Object (File)
Fri, Oct 9, 3:34 PM
Unknown Object (File)
Wed, Oct 7, 1:02 AM
Unknown Object (File)
Sun, Oct 4, 11:28 PM
Unknown Object (File)
Sun, Oct 4, 10:53 AM
Unknown Object (File)
Thu, Oct 1, 2:37 PM
Subscribers

Details

Summary

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
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable