Page MenuHomeFreeBSD

m4: Const correctness for C23
AcceptedPublic

Authored by ivy on Mon, Jul 27, 10:48 PM.
Tags
None
Referenced Files
F164493214: D58494.diff
Sat, Aug 1, 9:32 AM
Unknown Object (File)
Sat, Aug 1, 6:09 AM
Unknown Object (File)
Fri, Jul 31, 3:50 AM
Unknown Object (File)
Thu, Jul 30, 9:21 PM
Unknown Object (File)
Thu, Jul 30, 5:12 AM
Unknown Object (File)
Tue, Jul 28, 10:18 PM
Unknown Object (File)
Mon, Jul 27, 11:17 PM
Unknown Object (File)
Mon, Jul 27, 11:13 PM
Subscribers

Details

Reviewers
bapt
des
dim
kevans
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 75189
Build 72072: arc lint + arc unit

Event Timeline

ivy requested review of this revision.Mon, Jul 27, 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.Tue, Jul 28, 5:25 PM