mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85b07e977b04fceec84783facdb308492f17b155 Auto-Submitted: auto-generated Date: Mon, 03 Aug 2026 14:30:49 +0000 Message-Id: <6a70a619.362c3.1e6a748a@gitrepo.freebsd.org> The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=85b07e977b04fceec84783facdb308492f17b155 commit 85b07e977b04fceec84783facdb308492f17b155 Author: Lexi Winter AuthorDate: 2026-08-03 14:10:25 +0000 Commit: Lexi Winter CommitDate: 2026-08-03 14:10:25 +0000 libelftc: 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 libelftc during the bootstrap build, since it assumes the return value is always a mutable pointer. Since the returned pointer is never modified in either case, make it const. MFC after: 1 week Reviewed by: jkoshy, markj, dim, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58497 --- contrib/elftoolchain/libelftc/libelftc_dem_arm.c | 3 +-- contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/contrib/elftoolchain/libelftc/libelftc_dem_arm.c b/contrib/elftoolchain/libelftc/libelftc_dem_arm.c index ec87f6f7a11b..872cbce4c4a3 100644 --- a/contrib/elftoolchain/libelftc/libelftc_dem_arm.c +++ b/contrib/elftoolchain/libelftc/libelftc_dem_arm.c @@ -404,8 +404,7 @@ static bool read_func(struct demangle_data *d) { size_t len; - const char *name; - char *delim; + const char *name, *delim; if (d == NULL) return (false); diff --git a/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c b/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c index a414c7cdab80..df8d4e095384 100644 --- a/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c +++ b/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c @@ -255,7 +255,7 @@ clean: bool is_cpp_mangled_gnu2(const char *org) { - char *str; + const char *str; bool rtn = false; if (org == NULL) @@ -487,8 +487,7 @@ static bool read_func(struct demangle_data *d) { size_t len; - const char *name; - char *delim; + const char *name, *delim; if (d == NULL) return (false);