Page MenuHomeFreeBSD

m4: Const correctness for C23
ClosedPublic

Authored by ivy on Jul 27 2026, 10:48 PM.
Tags
None
Referenced Files
F170883698: D58494.diff
Mon, Sep 7, 7:13 AM
F170839588: D58494.diff
Sun, Sep 6, 11:22 PM
F170768596: D58494.id183310.diff
Sun, Sep 6, 12:53 PM
F170768041: D58494.diff
Sun, Sep 6, 12:47 PM
Unknown Object (File)
Sat, Sep 5, 2:00 PM
Unknown Object (File)
Sat, Sep 5, 11:05 AM
Unknown Object (File)
Sat, Sep 5, 11:01 AM
Unknown Object (File)
Sat, Sep 5, 10:33 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 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.