Page MenuHomeFreeBSD

libucl: Const correctness for C23
ClosedPublic

Authored by ivy on Jul 27 2026, 10:39 PM.
Tags
None
Referenced Files
F174952535: D58490.diff
Wed, Oct 7, 4:09 AM
F174825903: D58490.diff
Tue, Oct 6, 6:20 AM
Unknown Object (File)
Mon, Oct 5, 6:09 AM
Unknown Object (File)
Thu, Oct 1, 7:28 PM
Unknown Object (File)
Wed, Sep 30, 4:26 AM
Unknown Object (File)
Wed, Sep 30, 4:26 AM
Unknown Object (File)
Mon, Sep 28, 4:31 PM
Unknown Object (File)
Mon, Sep 28, 2:28 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 libucl during
the bootstrap build, since it assumes the return value is always
a mutable pointer.

Instead of assigning directly to params->prefix (which is const),
use a non-const temporary variable and assign the result after
we've done the modification.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

Diff Detail

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