Page MenuHomeFreeBSD

m4: Const correctness for C23
ClosedPublic

Authored by ivy on Mon, Jul 27, 10:48 PM.
Tags
None
Referenced Files
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
Unknown Object (File)
Sat, Aug 15, 8:04 AM
Unknown Object (File)
Tue, Aug 11, 12:23 PM
Unknown Object (File)
Sun, Aug 9, 3:18 PM
Unknown Object (File)
Sun, Aug 9, 3:17 PM
Unknown Object (File)
Sun, Aug 9, 8:57 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.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
This revision was automatically updated to reflect the committed changes.