Page MenuHomeFreeBSD

m4: Const correctness for C23
ClosedPublic

Authored by ivy on Jul 27 2026, 10:48 PM.
Tags
None
Referenced Files
F172140636: D58494.diff
Wed, Sep 16, 10:05 AM
Unknown Object (File)
Tue, Sep 15, 5:49 AM
Unknown Object (File)
Mon, Sep 14, 1:01 AM
Unknown Object (File)
Sun, Sep 13, 4:34 PM
Unknown Object (File)
Sun, Sep 13, 3:14 AM
Unknown Object (File)
Sat, Sep 12, 11:24 AM
Unknown Object (File)
Thu, Sep 10, 12:57 AM
Unknown Object (File)
Wed, Sep 9, 12:46 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 m4 during the
bootstrap build, since it assumes the return value is always a
mutable pointer.

Since the returned value is never modified, simply make the
temporary 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

Event Timeline

ivy requested review of this revision.Jul 27 2026, 10:48 PM

i've asked dlg@openbsd.org about upstreaming this.

In D58494#1342118, @ivy wrote:

i've asked dlg@openbsd.org about upstreaming this.

The upstream maintainer is espie at openbsd.

This revision is now accepted and ready to land.Jul 28 2026, 5:25 PM
This revision was automatically updated to reflect the committed changes.