Page MenuHomeFreeBSD

xinstall: Const correctness for C23
AcceptedPublic

Authored by ivy on Mon, Jul 27, 10:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Aug 1, 10:28 AM
Unknown Object (File)
Sat, Aug 1, 6:36 AM
Unknown Object (File)
Sat, Aug 1, 12:06 AM
Unknown Object (File)
Fri, Jul 31, 9:50 PM
Unknown Object (File)
Fri, Jul 31, 5:38 PM
Unknown Object (File)
Fri, Jul 31, 4:58 PM
Unknown Object (File)
Fri, Jul 31, 6:52 AM
Unknown Object (File)
Fri, Jul 31, 6:39 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 75187
Build 72070: arc lint + arc unit