From: Michael J Gruber Date: Thu, 26 Mar 2026 15:22:49 GMT Subject: [PATCH 3/6] do not discard const: adjust to non-const data types Message-ID: <8a65ada967b6b1308ea4cffca82102d4de8e9dd9.1774537954.git.git@grubix.eu> In-Reply-To: We use data types (such as string_list's util member) which are not necessarily "non-const in practice" (such as the list of environment variables in run-command.c) but are not declared "const". Rather than duplicating data types (e.g. with a new constr_string_list), discard the const explicitly for now to quell ISOC23 warnings. --- http-push.c | 2 +- run-command.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/http-push.c b/http-push.c index 9ae6062198..acc7f1d8fa 100644 --- a/http-push.c +++ b/http-push.c @@ -1772,7 +1772,7 @@ int cmd_main(int argc, const char **argv) str_end_url_with_slash(arg, &repo->url); repo->path_len = strlen(repo->url); if (path) { - repo->path = strchr(path+2, '/'); + repo->path = (char *) strchr(path+2, '/'); if (repo->path) repo->path_len = strlen(repo->path); } diff --git a/run-command.c b/run-command.c index 32c290ee6a..1db02ef030 100644 --- a/run-command.c +++ b/run-command.c @@ -604,7 +604,7 @@ static void trace_add_env(struct strbuf *dst, const char *const *deltaenv) /* Last one wins, see run-command.c:prep_childenv() for context */ for (e = deltaenv; e && *e; e++) { struct strbuf key = STRBUF_INIT; - char *equals = strchr(*e, '='); + char *equals = (char *) strchr(*e, '='); if (equals) { strbuf_add(&key, *e, equals - *e); -- 2.53.0.1195.g771ffcb452