Page MenuHomeFreeBSD

libucl: Const correctness for C23
ClosedPublic

Authored by ivy on Jul 27 2026, 10:39 PM.
Tags
None
Referenced Files
F172163017: D58490.diff
Wed, Sep 16, 1:22 PM
Unknown Object (File)
Mon, Sep 14, 10:20 AM
Unknown Object (File)
Mon, Sep 14, 7:38 AM
Unknown Object (File)
Wed, Sep 9, 7:39 PM
Unknown Object (File)
Mon, Sep 7, 2:06 PM
Unknown Object (File)
Mon, Sep 7, 2:17 AM
Unknown Object (File)
Sun, Sep 6, 9:36 PM
Unknown Object (File)
Sun, Sep 6, 11:50 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 Not Applicable
Unit
Tests Not Applicable