diff options
| author | Lexi Winter <ivy@FreeBSD.org> | 2026-08-03 14:09:03 +0000 |
|---|---|---|
| committer | Lexi Winter <ivy@FreeBSD.org> | 2026-08-03 14:09:03 +0000 |
| commit | 1d94e2e0f2ee21d5a4596efc0570d06e3dea0a6e (patch) | |
| tree | 89f1d6f6f3736ed36ba5506f87cc948ee3405a85 | |
| parent | 9fd8f5e761ba663c8e99eeff64c5a7fd7bcf1e05 (diff) | |
m4: Const correctness for C23
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
Reviewed by: bapt, dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58494
| -rw-r--r-- | usr.bin/m4/misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/m4/misc.c b/usr.bin/m4/misc.c index 24e91c572f4d..71d0734fa874 100644 --- a/usr.bin/m4/misc.c +++ b/usr.bin/m4/misc.c @@ -70,7 +70,7 @@ unsigned char *endpbb; /* end of push-back buffer */ ptrdiff_t doindex(const char *s1, const char *s2) { - char *t; + const char *t; t = strstr(s1, s2); if (t == NULL) |
