Page MenuHomeFreeBSD

m4: Const correctness for C23
ClosedPublic

Authored by ivy on Jul 27 2026, 10:48 PM.
Tags
None
Referenced Files
F168752702: D58494.diff
Sat, Aug 29, 11:32 PM
F168729125: D58494.diff
Sat, Aug 29, 8:39 PM
Unknown Object (File)
Fri, Aug 28, 10:02 PM
Unknown Object (File)
Fri, Aug 28, 6:30 AM
Unknown Object (File)
Thu, Aug 27, 5:12 AM
Unknown Object (File)
Sat, Aug 22, 7:44 AM
Unknown Object (File)
Sat, Aug 22, 7:40 AM
Unknown Object (File)
Wed, Aug 19, 9:59 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.