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)
Tue, Sep 15, 4:02 PM
Unknown Object (File)
Mon, Sep 14, 12:45 PM
Unknown Object (File)
Sun, Sep 13, 10:24 AM
Unknown Object (File)
Fri, Sep 11, 11:07 PM
Unknown Object (File)
Mon, Sep 7, 10:46 PM
Unknown Object (File)
Sat, Sep 5, 11:34 AM
Unknown Object (File)
Fri, Sep 4, 12:00 PM
Unknown Object (File)
Fri, Sep 4, 12:00 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