Page MenuHomeFreeBSD

libucl: Const correctness for C23
ClosedPublic

Authored by ivy on Jul 27 2026, 10:39 PM.
Tags
None
Referenced Files
F175141771: D58490.id183305.diff
Thu, Oct 8, 2:52 PM
Unknown Object (File)
Wed, Oct 7, 1:23 PM
Unknown Object (File)
Wed, Oct 7, 4:09 AM
Unknown Object (File)
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
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 75185
Build 72068: arc lint + arc unit