{"thread":{"id":"64922","subject":"[PATCH] global: constify some pointers that are not written to","startedAt":"2026-02-05T03:24:59Z","lastAt":"2026-02-06T15:54:47Z","messageCount":8,"participants":["Collin Funk","Jeff King","Junio C Hamano","Ben Knoble"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"535206","messageId":"342b01acd42f1fcaa3abefa38dc589e12ccb1134.1770261829.git.collin.funk1@gmail.com","threadId":"64922","inReplyTo":null,"subject":"[PATCH] global: constify some pointers that are not written to","fromName":"Collin Funk","fromEmail":"collin.funk1@gmail.com","sentAt":"2026-02-05T03:24:19Z","receivedAt":"2026-02-05T03:24:59Z","isPatch":true,"sender":{"key":"collin.funk1@gmail.com","avatar":"https://avatars.githubusercontent.com/u/65689063?v=4"},"body":"The recent glibc 2.43 release had the following change listed in its\nNEWS file:\n\n    For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,\n    strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return\n    pointers into their input arrays now have definitions as macros that\n    return a pointer to a const-qualified type when the input argument is\n    a pointer to a const-qualified type.\n\nWhen compiling with GCC 15, which defaults to -std=gnu23, this causes\nmany warnings like this:\n\n    merge-ort.c: In function ‘apply_directory_rename_modifications’:\n    merge-ort.c:2734:36: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]\n     2734 |                 char *last_slash = strrchr(cur_path, '/');\n          |                                    ^~~~~~~\n\nThis patch fixes the more obvious ones by making them const when we do\nnot write to the returned pointer.\n\nSigned-off-by: Collin Funk <collin.funk1@gmail.com>\n---\n add-patch.c                    | 2 +-\n apply.c                        | 2 +-\n builtin/commit.c               | 2 +-\n builtin/receive-pack.c         | 2 +-\n builtin/remote.c               | 2 +-\n builtin/shortlog.c             | 2 +-\n config.c                       | 2 +-\n convert.c                      | 3 ++-\n diff.c                         | 4 ++--\n diffcore-rename.c              | 2 +-\n fmt-merge-msg.c                | 3 ++-\n fsck.c                         | 2 +-\n gpg-interface.c                | 2 +-\n help.c                         | 2 +-\n http-push.c                    | 2 +-\n mailinfo.c                     | 2 +-\n mem-pool.c                     | 2 +-\n merge-ort.c                    | 2 +-\n object-name.c                  | 2 +-\n pack-revindex.c                | 2 +-\n pkt-line.c                     | 6 +++---\n reflog-walk.c                  | 3 ++-\n scalar.c                       | 2 +-\n strbuf.c                       | 2 +-\n string-list.c                  | 2 +-\n t/unit-tests/clar/clar/print.h | 2 +-\n transport.c                    | 2 +-\n wrapper.c                      | 2 +-\n 28 files changed, 34 insertions(+), 31 deletions(-)\n\ndiff --git a/add-patch.c b/add-patch.c\nindex 173a53241e..70242617ef 100644\n--- a/add-patch.c\n+++ b/add-patch.c\n@@ -342,7 +342,7 @@ static int parse_hunk_header(struct add_p_state *s, struct hunk *hunk)\n {\n \tstruct hunk_header *header = &hunk->header;\n \tconst char *line = s->plain.buf + hunk->start, *p = line;\n-\tchar *eol = memchr(p, '\\n', s->plain.len - hunk->start);\n+\tconst char *eol = memchr(p, '\\n', s->plain.len - hunk->start);\n \n \tif (!eol)\n \t\teol = s->plain.buf + s->plain.len;\ndiff --git a/apply.c b/apply.c\nindex 3de4aa4d2e..9de2eb953e 100644\n--- a/apply.c\n+++ b/apply.c\n@@ -4144,7 +4144,7 @@ static int preimage_oid_in_gitlink_patch(struct patch *p, struct object_id *oid)\n \t */\n \tstruct fragment *hunk = p->fragments;\n \tstatic const char heading[] = \"-Subproject commit \";\n-\tchar *preimage;\n+\tconst char *preimage;\n \n \tif (/* does the patch have only one hunk? */\n \t    hunk && !hunk->next &&\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 8e901fe8db..0326546548 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -816,7 +816,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\t\t\t  logfile);\n \t\thook_arg1 = \"message\";\n \t} else if (use_message) {\n-\t\tchar *buffer;\n+\t\tconst char *buffer;\n \t\tbuffer = strstr(use_message_buffer, \"\\n\\n\");\n \t\tif (buffer)\n \t\t\tstrbuf_addstr(&sb, skip_blank_lines(buffer + 2));\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex 9c49174616..e8b6f960fa 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -393,7 +393,7 @@ struct command {\n static void proc_receive_ref_append(const char *prefix)\n {\n \tstruct proc_receive_ref *ref_pattern;\n-\tchar *p;\n+\tconst char *p;\n \tint len;\n \n \tCALLOC_ARRAY(ref_pattern, 1);\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 7ffc14ba15..ace390c671 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -332,7 +332,7 @@ static int config_read_branches(const char *key, const char *value,\n \t\tinfo->remote_name = xstrdup(value);\n \t\tbreak;\n \tcase MERGE: {\n-\t\tchar *space = strchr(value, ' ');\n+\t\tconst char *space = strchr(value, ' ');\n \t\tvalue = abbrev_branch(value);\n \t\twhile (space) {\n \t\t\tchar *merge;\ndiff --git a/builtin/shortlog.c b/builtin/shortlog.c\nindex b91acf45c8..d80bf1a7d0 100644\n--- a/builtin/shortlog.c\n+++ b/builtin/shortlog.c\n@@ -76,7 +76,7 @@ static void insert_one_record(struct shortlog *log,\n \t\tif (!eol)\n \t\t\teol = oneline + strlen(oneline);\n \t\tif (starts_with(oneline, \"[PATCH\")) {\n-\t\t\tchar *eob = strchr(oneline, ']');\n+\t\t\tconst char *eob = strchr(oneline, ']');\n \t\t\tif (eob && (!eol || eob < eol))\n \t\t\t\toneline = eob + 1;\n \t\t}\ndiff --git a/config.c b/config.c\nindex 7f6d53b473..156f2a24fa 100644\n--- a/config.c\n+++ b/config.c\n@@ -160,7 +160,7 @@ static int handle_path_include(const struct key_value_info *kvi,\n \t * based on the including config file.\n \t */\n \tif (!is_absolute_path(path)) {\n-\t\tchar *slash;\n+\t\tconst char *slash;\n \n \t\tif (!kvi || kvi->origin_type != CONFIG_ORIGIN_FILE) {\n \t\t\tret = error(_(\"relative config includes must come from files\"));\ndiff --git a/convert.c b/convert.c\nindex c7d6a85c22..a34ec6ecdc 100644\n--- a/convert.c\n+++ b/convert.c\n@@ -1122,7 +1122,8 @@ static int count_ident(const char *cp, unsigned long size)\n static int ident_to_git(const char *src, size_t len,\n \t\t\tstruct strbuf *buf, int ident)\n {\n-\tchar *dst, *dollar;\n+\tchar *dst;\n+\tconst char *dollar;\n \n \tif (!ident || (src && !count_ident(src, len)))\n \t\treturn 0;\ndiff --git a/diff.c b/diff.c\nindex a68ddd2168..2d92665159 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1961,7 +1961,7 @@ static int fn_out_diff_words_write_helper(struct diff_options *o,\n \tstruct strbuf sb = STRBUF_INIT;\n \n \twhile (count) {\n-\t\tchar *p = memchr(buf, '\\n', count);\n+\t\tconst char *p = memchr(buf, '\\n', count);\n \t\tif (print)\n \t\t\tstrbuf_addstr(&sb, diff_line_prefix(o));\n \n@@ -3049,7 +3049,7 @@ static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir,\n \t\tstruct dirstat_file *f = dir->files;\n \t\tint namelen = strlen(f->name);\n \t\tunsigned long changes;\n-\t\tchar *slash;\n+\t\tconst char *slash;\n \n \t\tif (namelen < baselen)\n \t\t\tbreak;\ndiff --git a/diffcore-rename.c b/diffcore-rename.c\nindex 7723bc3334..d9476db35a 100644\n--- a/diffcore-rename.c\n+++ b/diffcore-rename.c\n@@ -379,7 +379,7 @@ struct dir_rename_info {\n \n static char *get_dirname(const char *filename)\n {\n-\tchar *slash = strrchr(filename, '/');\n+\tconst char *slash = strrchr(filename, '/');\n \treturn slash ? xstrndup(filename, slash - filename) : xstrdup(\"\");\n }\n \ndiff --git a/fmt-merge-msg.c b/fmt-merge-msg.c\nindex c9085edc40..1626667c0d 100644\n--- a/fmt-merge-msg.c\n+++ b/fmt-merge-msg.c\n@@ -246,7 +246,8 @@ static void add_branch_desc(struct strbuf *out, const char *name)\n static void record_person_from_buf(int which, struct string_list *people,\n \t\t\t\t   const char *buffer)\n {\n-\tchar *name_buf, *name, *name_end;\n+\tchar *name_buf;\n+\tconst char *name, *name_end;\n \tstruct string_list_item *elem;\n \tconst char *field;\n \ndiff --git a/fsck.c b/fsck.c\nindex 3afec0d0d3..0f02cf8f77 100644\n--- a/fsck.c\n+++ b/fsck.c\n@@ -1026,7 +1026,7 @@ int fsck_tag_standalone(const struct object_id *oid, const char *buffer,\n \t\t\tint *tagged_type)\n {\n \tint ret = 0;\n-\tchar *eol;\n+\tconst char *eol;\n \tstruct strbuf sb = STRBUF_INIT;\n \tconst char *buffer_end = buffer + size;\n \tconst char *p;\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 47222bf31b..87fb6605fb 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -398,7 +398,7 @@ static void parse_ssh_output(struct signature_check *sigc)\n {\n \tconst char *line, *principal, *search;\n \tchar *to_free;\n-\tchar *key = NULL;\n+\tconst char *key;\n \n \t/*\n \t * ssh-keygen output should be:\ndiff --git a/help.c b/help.c\nindex 3c36d9c218..be334d7642 100644\n--- a/help.c\n+++ b/help.c\n@@ -857,7 +857,7 @@ struct similar_ref_cb {\n static int append_similar_ref(const struct reference *ref, void *cb_data)\n {\n \tstruct similar_ref_cb *cb = (struct similar_ref_cb *)(cb_data);\n-\tchar *branch = strrchr(ref->name, '/') + 1;\n+\tconst char *branch = strrchr(ref->name, '/') + 1;\n \n \t/* A remote branch of the same name is deemed similar */\n \tif (starts_with(ref->name, \"refs/remotes/\") &&\ndiff --git a/http-push.c b/http-push.c\nindex cc0f809346..9ae6062198 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1768,7 +1768,7 @@ int cmd_main(int argc, const char **argv)\n \t\t\t\tusage(http_push_usage);\n \t\t}\n \t\tif (!repo->url) {\n-\t\t\tchar *path = strstr(arg, \"//\");\n+\t\t\tconst char *path = strstr(arg, \"//\");\n \t\t\tstr_end_url_with_slash(arg, &repo->url);\n \t\t\trepo->path_len = strlen(repo->url);\n \t\t\tif (path) {\ndiff --git a/mailinfo.c b/mailinfo.c\nindex 99ac596e09..a2f06dbd96 100644\n--- a/mailinfo.c\n+++ b/mailinfo.c\n@@ -1141,7 +1141,7 @@ static void output_header_lines(FILE *fout, const char *hdr, const struct strbuf\n {\n \tconst char *sp = data->buf;\n \twhile (1) {\n-\t\tchar *ep = strchr(sp, '\\n');\n+\t\tconst char *ep = strchr(sp, '\\n');\n \t\tint len;\n \t\tif (!ep)\n \t\t\tlen = strlen(sp);\ndiff --git a/mem-pool.c b/mem-pool.c\nindex 62441dcc71..8bc77cb0e8 100644\n--- a/mem-pool.c\n+++ b/mem-pool.c\n@@ -169,7 +169,7 @@ char *mem_pool_strdup(struct mem_pool *pool, const char *str)\n \n char *mem_pool_strndup(struct mem_pool *pool, const char *str, size_t len)\n {\n-\tchar *p = memchr(str, '\\0', len);\n+\tconst char *p = memchr(str, '\\0', len);\n \tsize_t actual_len = (p ? p - str : len);\n \tchar *ret = mem_pool_alloc(pool, actual_len+1);\n \ndiff --git a/merge-ort.c b/merge-ort.c\nindex e80e4f735a..6f30471b49 100644\n--- a/merge-ort.c\n+++ b/merge-ort.c\n@@ -2731,7 +2731,7 @@ static void apply_directory_rename_modifications(struct merge_options *opt,\n \n \twhile (1) {\n \t\t/* Find the parent directory of cur_path */\n-\t\tchar *last_slash = strrchr(cur_path, '/');\n+\t\tconst char *last_slash = strrchr(cur_path, '/');\n \t\tif (last_slash) {\n \t\t\tparent_name = mem_pool_strndup(&opt->priv->pool,\n \t\t\t\t\t\t       cur_path,\ndiff --git a/object-name.c b/object-name.c\nindex 8b862c124e..e1b09d823c 100644\n--- a/object-name.c\n+++ b/object-name.c\n@@ -1756,7 +1756,7 @@ int repo_interpret_branch_name(struct repository *r,\n \t\t\t       struct strbuf *buf,\n \t\t\t       const struct interpret_branch_name_options *options)\n {\n-\tchar *at;\n+\tconst char *at;\n \tconst char *start;\n \tint len;\n \ndiff --git a/pack-revindex.c b/pack-revindex.c\nindex 8598b941c8..56cd803a67 100644\n--- a/pack-revindex.c\n+++ b/pack-revindex.c\n@@ -544,7 +544,7 @@ static int midx_key_to_pack_pos(struct multi_pack_index *m,\n \t\t\t\tstruct midx_pack_key *key,\n \t\t\t\tuint32_t *pos)\n {\n-\tuint32_t *found;\n+\tconst uint32_t *found;\n \n \tif (key->pack >= m->num_packs + m->num_packs_in_base)\n \t\tBUG(\"MIDX pack lookup out of bounds (%\"PRIu32\" >= %\"PRIu32\")\",\ndiff --git a/pkt-line.c b/pkt-line.c\nindex fc583feb26..3fc3e9ea70 100644\n--- a/pkt-line.c\n+++ b/pkt-line.c\n@@ -384,10 +384,10 @@ int packet_length(const char lenbuf_hex[4], size_t size)\n \t\thexval(lenbuf_hex[3]);\n }\n \n-static char *find_packfile_uri_path(const char *buffer)\n+static const char *find_packfile_uri_path(const char *buffer)\n {\n \tconst char *URI_MARK = \"://\";\n-\tchar *path;\n+\tconst char *path;\n \tint len;\n \n \t/* First char is sideband mark */\n@@ -417,7 +417,7 @@ enum packet_read_status packet_read_with_status(int fd, char **src_buffer,\n {\n \tint len;\n \tchar linelen[4];\n-\tchar *uri_path_start;\n+\tconst char *uri_path_start;\n \n \tif (get_packet_data(fd, src_buffer, src_len, linelen, 4, options) < 0) {\n \t\t*pktlen = -1;\ndiff --git a/reflog-walk.c b/reflog-walk.c\nindex 4f1ce04749..4dbeaa93a7 100644\n--- a/reflog-walk.c\n+++ b/reflog-walk.c\n@@ -157,7 +157,8 @@ int add_reflog_for_walk(struct reflog_walk_info *info,\n \tint recno = -1;\n \tstruct string_list_item *item;\n \tstruct complete_reflogs *reflogs;\n-\tchar *branch, *at = strchr(name, '@');\n+\tchar *branch;\n+\tconst char *at = strchr(name, '@');\n \tstruct commit_reflog *commit_reflog;\n \tenum selector_type selector = SELECTOR_NONE;\n \ndiff --git a/scalar.c b/scalar.c\nindex c9df9348ec..4efb6ac36d 100644\n--- a/scalar.c\n+++ b/scalar.c\n@@ -393,7 +393,7 @@ static int delete_enlistment(struct strbuf *enlistment)\n {\n \tstruct strbuf parent = STRBUF_INIT;\n \tsize_t offset;\n-\tchar *path_sep;\n+\tconst char *path_sep;\n \n \tif (unregister_dir())\n \t\treturn error(_(\"failed to unregister repository\"));\ndiff --git a/strbuf.c b/strbuf.c\nindex 59678bf5b0..3939863cf3 100644\n--- a/strbuf.c\n+++ b/strbuf.c\n@@ -1119,6 +1119,6 @@ void strbuf_stripspace(struct strbuf *sb, const char *comment_prefix)\n \n void strbuf_strip_file_from_path(struct strbuf *sb)\n {\n-\tchar *path_sep = find_last_dir_sep(sb->buf);\n+\tconst char *path_sep = find_last_dir_sep(sb->buf);\n \tstrbuf_setlen(sb, path_sep ? path_sep - sb->buf + 1 : 0);\n }\ndiff --git a/string-list.c b/string-list.c\nindex 08dc00984c..7c34a425da 100644\n--- a/string-list.c\n+++ b/string-list.c\n@@ -327,7 +327,7 @@ static int split_string(struct string_list *list, const char *string, const char\n \t\tBUG(\"string_list_split() called without strdup_strings\");\n \n \tfor (;;) {\n-\t\tchar *end;\n+\t\tconst char *end;\n \n \t\tif (flags & STRING_LIST_SPLIT_TRIM) {\n \t\t\t/* ltrim */\ndiff --git a/t/unit-tests/clar/clar/print.h b/t/unit-tests/clar/clar/print.h\nindex 6a2321b399..59b7dc14a1 100644\n--- a/t/unit-tests/clar/clar/print.h\n+++ b/t/unit-tests/clar/clar/print.h\n@@ -127,7 +127,7 @@ static void clar_print_tap_error(int num, const struct clar_report *report, cons\n \n static void print_escaped(const char *str)\n {\n-\tchar *c;\n+\tconst char *c;\n \n \twhile ((c = strchr(str, '\\'')) != NULL) {\n \t\tprintf(\"%.*s\", (int)(c - str), str);\ndiff --git a/transport.c b/transport.c\nindex c7f06a7382..845fd441be 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -1657,7 +1657,7 @@ int transport_disconnect(struct transport *transport)\n  */\n char *transport_anonymize_url(const char *url)\n {\n-\tchar *scheme_prefix, *anon_part;\n+\tconst char *scheme_prefix, *anon_part;\n \tsize_t anon_len, prefix_len = 0;\n \n \tanon_part = strchr(url, '@');\ndiff --git a/wrapper.c b/wrapper.c\nindex b794fb20e7..16f5a63fbb 100644\n--- a/wrapper.c\n+++ b/wrapper.c\n@@ -115,7 +115,7 @@ void *xmemdupz(const void *data, size_t len)\n \n char *xstrndup(const char *str, size_t len)\n {\n-\tchar *p = memchr(str, '\\0', len);\n+\tconst char *p = memchr(str, '\\0', len);\n \treturn xmemdupz(str, p ? p - str : len);\n }\n \n-- \n2.52.0\n\n"},{"id":"535210","messageId":"20260205074139.GA1019015@coredump.intra.peff.net","threadId":"64922","inReplyTo":"342b01acd42f1fcaa3abefa38dc589e12ccb1134.1770261829.git.collin.funk1@gmail.com","subject":"Re: [PATCH] global: constify some pointers that are not written to","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-02-05T07:41:39Z","receivedAt":"2026-02-05T07:41:50Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Feb 04, 2026 at 07:24:19PM -0800, Collin Funk wrote:\n\n> This patch fixes the more obvious ones by making them const when we do\n> not write to the returned pointer.\n\nThanks, this looks like a good start. All of the changes look correct to\nme (and can be confirmed with the compiler). I also cross-checked them\nagainst my own earlier hacky pass. The only difference was in this hunk:\n\n> diff --git a/gpg-interface.c b/gpg-interface.c\n> index 47222bf31b..87fb6605fb 100644\n> --- a/gpg-interface.c\n> +++ b/gpg-interface.c\n> @@ -398,7 +398,7 @@ static void parse_ssh_output(struct signature_check *sigc)\n>  {\n>  \tconst char *line, *principal, *search;\n>  \tchar *to_free;\n> -\tchar *key = NULL;\n> +\tconst char *key;\n\nYou've dropped the NULL initialization here. That's OK to do, as the\nNULL is never used (we assign \"key\" immediately before the first time we\nlook at it). But it probably makes sense for this patch to change only\none thing. So either leave the dead initialization, or remove it as a\nseparate patch.\n\n-Peff\n"},{"id":"535269","messageId":"xmqqecmzm66r.fsf@gitster.g","threadId":"64922","inReplyTo":"342b01acd42f1fcaa3abefa38dc589e12ccb1134.1770261829.git.collin.funk1@gmail.com","subject":"Re: [PATCH] global: constify some pointers that are not written to","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-05T17:49:32Z","receivedAt":"2026-02-05T17:49:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Collin Funk <collin.funk1@gmail.com> writes:\n\n> This patch fixes the more obvious ones by making them const when we do\n> not write to the returned pointer.\n>\n> Signed-off-by: Collin Funk <collin.funk1@gmail.com>\n> ---\n>  add-patch.c                    | 2 +-\n>  apply.c                        | 2 +-\n>  builtin/commit.c               | 2 +-\n>  builtin/receive-pack.c         | 2 +-\n>  builtin/remote.c               | 2 +-\n> ...\n>  wrapper.c                      | 2 +-\n>  28 files changed, 34 insertions(+), 31 deletions(-)\n\nIndeed, the number of files makes it look worse than it really is.\n\n> diff --git a/pkt-line.c b/pkt-line.c\n> index fc583feb26..3fc3e9ea70 100644\n> --- a/pkt-line.c\n> +++ b/pkt-line.c\n> @@ -384,10 +384,10 @@ int packet_length(const char lenbuf_hex[4], size_t size)\n>  \t\thexval(lenbuf_hex[3]);\n>  }\n>  \n> -static char *find_packfile_uri_path(const char *buffer)\n> +static const char *find_packfile_uri_path(const char *buffer)\n>  {\n>  \tconst char *URI_MARK = \"://\";\n> -\tchar *path;\n> +\tconst char *path;\n>  \tint len;\n>  \n>  \t/* First char is sideband mark */\n\nEverything other than this hunk is adding \"const\" to local pointers\nand compilers will complain if we depended on them being writable,\nso this is an easy patch to review.  We can trust even this hunk to\ncompilers, as the callers of this function would be flagged if they\ntried to write through the return value from it.\n\nLooking good.  I agree with Peff that the removal of unused NULL\ninitialization would have been much better done in a separate patch.\n\nThanks.\n"},{"id":"535286","messageId":"87343ec0kt.fsf@gmail.com","threadId":"64922","inReplyTo":"xmqqecmzm66r.fsf@gitster.g","subject":"Re: [PATCH] global: constify some pointers that are not written to","fromName":"Collin Funk","fromEmail":"collin.funk1@gmail.com","sentAt":"2026-02-05T22:00:50Z","receivedAt":"2026-02-05T22:00:53Z","isPatch":true,"sender":{"key":"collin.funk1@gmail.com","avatar":"https://avatars.githubusercontent.com/u/65689063?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> diff --git a/pkt-line.c b/pkt-line.c\n>> index fc583feb26..3fc3e9ea70 100644\n>> --- a/pkt-line.c\n>> +++ b/pkt-line.c\n>> @@ -384,10 +384,10 @@ int packet_length(const char lenbuf_hex[4], size_t size)\n>>  \t\thexval(lenbuf_hex[3]);\n>>  }\n>>  \n>> -static char *find_packfile_uri_path(const char *buffer)\n>> +static const char *find_packfile_uri_path(const char *buffer)\n>>  {\n>>  \tconst char *URI_MARK = \"://\";\n>> -\tchar *path;\n>> +\tconst char *path;\n>>  \tint len;\n>>  \n>>  \t/* First char is sideband mark */\n>\n> Everything other than this hunk is adding \"const\" to local pointers\n> and compilers will complain if we depended on them being writable,\n> so this is an easy patch to review.  We can trust even this hunk to\n> compilers, as the callers of this function would be flagged if they\n> tried to write through the return value from it.\n>\n> Looking good.  I agree with Peff that the removal of unused NULL\n> initialization would have been much better done in a separate patch.\n\nAck. I figured it would be okay since I was already changing the line.\nBut noted that Git is a bit more organized than me.\n\nI'll send a V2 later which splits that into a separate patch.\n\nThanks both for the review.\n\nCollin\n"},{"id":"535289","messageId":"a53fd33b5696487f941faace90f51153555ce8f4.1770342268.git.collin.funk1@gmail.com","threadId":"64922","inReplyTo":"342b01acd42f1fcaa3abefa38dc589e12ccb1134.1770261829.git.collin.funk1@gmail.com","subject":"[PATCH v2 1/2] global: constify some pointers that are not written to","fromName":"Collin Funk","fromEmail":"collin.funk1@gmail.com","sentAt":"2026-02-06T01:46:09Z","receivedAt":"2026-02-06T01:47:19Z","isPatch":true,"sender":{"key":"collin.funk1@gmail.com","avatar":"https://avatars.githubusercontent.com/u/65689063?v=4"},"body":"This v2 just moves the unrelated change mentioned in review to a\nseparate patch.\n\n-- 8< --\n\nThe recent glibc 2.43 release had the following change listed in its\nNEWS file:\n\n    For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,\n    strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return\n    pointers into their input arrays now have definitions as macros that\n    return a pointer to a const-qualified type when the input argument is\n    a pointer to a const-qualified type.\n\nWhen compiling with GCC 15, which defaults to -std=gnu23, this causes\nmany warnings like this:\n\n    merge-ort.c: In function ‘apply_directory_rename_modifications’:\n    merge-ort.c:2734:36: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]\n     2734 |                 char *last_slash = strrchr(cur_path, '/');\n          |                                    ^~~~~~~\n\nThis patch fixes the more obvious ones by making them const when we do\nnot write to the returned pointer.\n\nSigned-off-by: Collin Funk <collin.funk1@gmail.com>\n---\n add-patch.c                    | 2 +-\n apply.c                        | 2 +-\n builtin/commit.c               | 2 +-\n builtin/receive-pack.c         | 2 +-\n builtin/remote.c               | 2 +-\n builtin/shortlog.c             | 2 +-\n config.c                       | 2 +-\n convert.c                      | 3 ++-\n diff.c                         | 4 ++--\n diffcore-rename.c              | 2 +-\n fmt-merge-msg.c                | 3 ++-\n fsck.c                         | 2 +-\n gpg-interface.c                | 2 +-\n help.c                         | 2 +-\n http-push.c                    | 2 +-\n mailinfo.c                     | 2 +-\n mem-pool.c                     | 2 +-\n merge-ort.c                    | 2 +-\n object-name.c                  | 2 +-\n pack-revindex.c                | 2 +-\n pkt-line.c                     | 6 +++---\n reflog-walk.c                  | 3 ++-\n scalar.c                       | 2 +-\n strbuf.c                       | 2 +-\n string-list.c                  | 2 +-\n t/unit-tests/clar/clar/print.h | 2 +-\n transport.c                    | 2 +-\n wrapper.c                      | 2 +-\n 28 files changed, 34 insertions(+), 31 deletions(-)\n\ndiff --git a/add-patch.c b/add-patch.c\nindex 173a53241e..70242617ef 100644\n--- a/add-patch.c\n+++ b/add-patch.c\n@@ -342,7 +342,7 @@ static int parse_hunk_header(struct add_p_state *s, struct hunk *hunk)\n {\n \tstruct hunk_header *header = &hunk->header;\n \tconst char *line = s->plain.buf + hunk->start, *p = line;\n-\tchar *eol = memchr(p, '\\n', s->plain.len - hunk->start);\n+\tconst char *eol = memchr(p, '\\n', s->plain.len - hunk->start);\n \n \tif (!eol)\n \t\teol = s->plain.buf + s->plain.len;\ndiff --git a/apply.c b/apply.c\nindex 3de4aa4d2e..9de2eb953e 100644\n--- a/apply.c\n+++ b/apply.c\n@@ -4144,7 +4144,7 @@ static int preimage_oid_in_gitlink_patch(struct patch *p, struct object_id *oid)\n \t */\n \tstruct fragment *hunk = p->fragments;\n \tstatic const char heading[] = \"-Subproject commit \";\n-\tchar *preimage;\n+\tconst char *preimage;\n \n \tif (/* does the patch have only one hunk? */\n \t    hunk && !hunk->next &&\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 8e901fe8db..0326546548 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -816,7 +816,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\t\t\t  logfile);\n \t\thook_arg1 = \"message\";\n \t} else if (use_message) {\n-\t\tchar *buffer;\n+\t\tconst char *buffer;\n \t\tbuffer = strstr(use_message_buffer, \"\\n\\n\");\n \t\tif (buffer)\n \t\t\tstrbuf_addstr(&sb, skip_blank_lines(buffer + 2));\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex 9c49174616..e8b6f960fa 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -393,7 +393,7 @@ struct command {\n static void proc_receive_ref_append(const char *prefix)\n {\n \tstruct proc_receive_ref *ref_pattern;\n-\tchar *p;\n+\tconst char *p;\n \tint len;\n \n \tCALLOC_ARRAY(ref_pattern, 1);\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 7ffc14ba15..ace390c671 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -332,7 +332,7 @@ static int config_read_branches(const char *key, const char *value,\n \t\tinfo->remote_name = xstrdup(value);\n \t\tbreak;\n \tcase MERGE: {\n-\t\tchar *space = strchr(value, ' ');\n+\t\tconst char *space = strchr(value, ' ');\n \t\tvalue = abbrev_branch(value);\n \t\twhile (space) {\n \t\t\tchar *merge;\ndiff --git a/builtin/shortlog.c b/builtin/shortlog.c\nindex b91acf45c8..d80bf1a7d0 100644\n--- a/builtin/shortlog.c\n+++ b/builtin/shortlog.c\n@@ -76,7 +76,7 @@ static void insert_one_record(struct shortlog *log,\n \t\tif (!eol)\n \t\t\teol = oneline + strlen(oneline);\n \t\tif (starts_with(oneline, \"[PATCH\")) {\n-\t\t\tchar *eob = strchr(oneline, ']');\n+\t\t\tconst char *eob = strchr(oneline, ']');\n \t\t\tif (eob && (!eol || eob < eol))\n \t\t\t\toneline = eob + 1;\n \t\t}\ndiff --git a/config.c b/config.c\nindex 7f6d53b473..156f2a24fa 100644\n--- a/config.c\n+++ b/config.c\n@@ -160,7 +160,7 @@ static int handle_path_include(const struct key_value_info *kvi,\n \t * based on the including config file.\n \t */\n \tif (!is_absolute_path(path)) {\n-\t\tchar *slash;\n+\t\tconst char *slash;\n \n \t\tif (!kvi || kvi->origin_type != CONFIG_ORIGIN_FILE) {\n \t\t\tret = error(_(\"relative config includes must come from files\"));\ndiff --git a/convert.c b/convert.c\nindex c7d6a85c22..a34ec6ecdc 100644\n--- a/convert.c\n+++ b/convert.c\n@@ -1122,7 +1122,8 @@ static int count_ident(const char *cp, unsigned long size)\n static int ident_to_git(const char *src, size_t len,\n \t\t\tstruct strbuf *buf, int ident)\n {\n-\tchar *dst, *dollar;\n+\tchar *dst;\n+\tconst char *dollar;\n \n \tif (!ident || (src && !count_ident(src, len)))\n \t\treturn 0;\ndiff --git a/diff.c b/diff.c\nindex a68ddd2168..2d92665159 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1961,7 +1961,7 @@ static int fn_out_diff_words_write_helper(struct diff_options *o,\n \tstruct strbuf sb = STRBUF_INIT;\n \n \twhile (count) {\n-\t\tchar *p = memchr(buf, '\\n', count);\n+\t\tconst char *p = memchr(buf, '\\n', count);\n \t\tif (print)\n \t\t\tstrbuf_addstr(&sb, diff_line_prefix(o));\n \n@@ -3049,7 +3049,7 @@ static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir,\n \t\tstruct dirstat_file *f = dir->files;\n \t\tint namelen = strlen(f->name);\n \t\tunsigned long changes;\n-\t\tchar *slash;\n+\t\tconst char *slash;\n \n \t\tif (namelen < baselen)\n \t\t\tbreak;\ndiff --git a/diffcore-rename.c b/diffcore-rename.c\nindex 7723bc3334..d9476db35a 100644\n--- a/diffcore-rename.c\n+++ b/diffcore-rename.c\n@@ -379,7 +379,7 @@ struct dir_rename_info {\n \n static char *get_dirname(const char *filename)\n {\n-\tchar *slash = strrchr(filename, '/');\n+\tconst char *slash = strrchr(filename, '/');\n \treturn slash ? xstrndup(filename, slash - filename) : xstrdup(\"\");\n }\n \ndiff --git a/fmt-merge-msg.c b/fmt-merge-msg.c\nindex c9085edc40..1626667c0d 100644\n--- a/fmt-merge-msg.c\n+++ b/fmt-merge-msg.c\n@@ -246,7 +246,8 @@ static void add_branch_desc(struct strbuf *out, const char *name)\n static void record_person_from_buf(int which, struct string_list *people,\n \t\t\t\t   const char *buffer)\n {\n-\tchar *name_buf, *name, *name_end;\n+\tchar *name_buf;\n+\tconst char *name, *name_end;\n \tstruct string_list_item *elem;\n \tconst char *field;\n \ndiff --git a/fsck.c b/fsck.c\nindex 3afec0d0d3..0f02cf8f77 100644\n--- a/fsck.c\n+++ b/fsck.c\n@@ -1026,7 +1026,7 @@ int fsck_tag_standalone(const struct object_id *oid, const char *buffer,\n \t\t\tint *tagged_type)\n {\n \tint ret = 0;\n-\tchar *eol;\n+\tconst char *eol;\n \tstruct strbuf sb = STRBUF_INIT;\n \tconst char *buffer_end = buffer + size;\n \tconst char *p;\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 47222bf31b..377c0cf49f 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -398,7 +398,7 @@ static void parse_ssh_output(struct signature_check *sigc)\n {\n \tconst char *line, *principal, *search;\n \tchar *to_free;\n-\tchar *key = NULL;\n+\tconst char *key = NULL;\n \n \t/*\n \t * ssh-keygen output should be:\ndiff --git a/help.c b/help.c\nindex 3c36d9c218..be334d7642 100644\n--- a/help.c\n+++ b/help.c\n@@ -857,7 +857,7 @@ struct similar_ref_cb {\n static int append_similar_ref(const struct reference *ref, void *cb_data)\n {\n \tstruct similar_ref_cb *cb = (struct similar_ref_cb *)(cb_data);\n-\tchar *branch = strrchr(ref->name, '/') + 1;\n+\tconst char *branch = strrchr(ref->name, '/') + 1;\n \n \t/* A remote branch of the same name is deemed similar */\n \tif (starts_with(ref->name, \"refs/remotes/\") &&\ndiff --git a/http-push.c b/http-push.c\nindex cc0f809346..9ae6062198 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1768,7 +1768,7 @@ int cmd_main(int argc, const char **argv)\n \t\t\t\tusage(http_push_usage);\n \t\t}\n \t\tif (!repo->url) {\n-\t\t\tchar *path = strstr(arg, \"//\");\n+\t\t\tconst char *path = strstr(arg, \"//\");\n \t\t\tstr_end_url_with_slash(arg, &repo->url);\n \t\t\trepo->path_len = strlen(repo->url);\n \t\t\tif (path) {\ndiff --git a/mailinfo.c b/mailinfo.c\nindex 99ac596e09..a2f06dbd96 100644\n--- a/mailinfo.c\n+++ b/mailinfo.c\n@@ -1141,7 +1141,7 @@ static void output_header_lines(FILE *fout, const char *hdr, const struct strbuf\n {\n \tconst char *sp = data->buf;\n \twhile (1) {\n-\t\tchar *ep = strchr(sp, '\\n');\n+\t\tconst char *ep = strchr(sp, '\\n');\n \t\tint len;\n \t\tif (!ep)\n \t\t\tlen = strlen(sp);\ndiff --git a/mem-pool.c b/mem-pool.c\nindex 62441dcc71..8bc77cb0e8 100644\n--- a/mem-pool.c\n+++ b/mem-pool.c\n@@ -169,7 +169,7 @@ char *mem_pool_strdup(struct mem_pool *pool, const char *str)\n \n char *mem_pool_strndup(struct mem_pool *pool, const char *str, size_t len)\n {\n-\tchar *p = memchr(str, '\\0', len);\n+\tconst char *p = memchr(str, '\\0', len);\n \tsize_t actual_len = (p ? p - str : len);\n \tchar *ret = mem_pool_alloc(pool, actual_len+1);\n \ndiff --git a/merge-ort.c b/merge-ort.c\nindex e80e4f735a..6f30471b49 100644\n--- a/merge-ort.c\n+++ b/merge-ort.c\n@@ -2731,7 +2731,7 @@ static void apply_directory_rename_modifications(struct merge_options *opt,\n \n \twhile (1) {\n \t\t/* Find the parent directory of cur_path */\n-\t\tchar *last_slash = strrchr(cur_path, '/');\n+\t\tconst char *last_slash = strrchr(cur_path, '/');\n \t\tif (last_slash) {\n \t\t\tparent_name = mem_pool_strndup(&opt->priv->pool,\n \t\t\t\t\t\t       cur_path,\ndiff --git a/object-name.c b/object-name.c\nindex 8b862c124e..e1b09d823c 100644\n--- a/object-name.c\n+++ b/object-name.c\n@@ -1756,7 +1756,7 @@ int repo_interpret_branch_name(struct repository *r,\n \t\t\t       struct strbuf *buf,\n \t\t\t       const struct interpret_branch_name_options *options)\n {\n-\tchar *at;\n+\tconst char *at;\n \tconst char *start;\n \tint len;\n \ndiff --git a/pack-revindex.c b/pack-revindex.c\nindex 8598b941c8..56cd803a67 100644\n--- a/pack-revindex.c\n+++ b/pack-revindex.c\n@@ -544,7 +544,7 @@ static int midx_key_to_pack_pos(struct multi_pack_index *m,\n \t\t\t\tstruct midx_pack_key *key,\n \t\t\t\tuint32_t *pos)\n {\n-\tuint32_t *found;\n+\tconst uint32_t *found;\n \n \tif (key->pack >= m->num_packs + m->num_packs_in_base)\n \t\tBUG(\"MIDX pack lookup out of bounds (%\"PRIu32\" >= %\"PRIu32\")\",\ndiff --git a/pkt-line.c b/pkt-line.c\nindex fc583feb26..3fc3e9ea70 100644\n--- a/pkt-line.c\n+++ b/pkt-line.c\n@@ -384,10 +384,10 @@ int packet_length(const char lenbuf_hex[4], size_t size)\n \t\thexval(lenbuf_hex[3]);\n }\n \n-static char *find_packfile_uri_path(const char *buffer)\n+static const char *find_packfile_uri_path(const char *buffer)\n {\n \tconst char *URI_MARK = \"://\";\n-\tchar *path;\n+\tconst char *path;\n \tint len;\n \n \t/* First char is sideband mark */\n@@ -417,7 +417,7 @@ enum packet_read_status packet_read_with_status(int fd, char **src_buffer,\n {\n \tint len;\n \tchar linelen[4];\n-\tchar *uri_path_start;\n+\tconst char *uri_path_start;\n \n \tif (get_packet_data(fd, src_buffer, src_len, linelen, 4, options) < 0) {\n \t\t*pktlen = -1;\ndiff --git a/reflog-walk.c b/reflog-walk.c\nindex 4f1ce04749..4dbeaa93a7 100644\n--- a/reflog-walk.c\n+++ b/reflog-walk.c\n@@ -157,7 +157,8 @@ int add_reflog_for_walk(struct reflog_walk_info *info,\n \tint recno = -1;\n \tstruct string_list_item *item;\n \tstruct complete_reflogs *reflogs;\n-\tchar *branch, *at = strchr(name, '@');\n+\tchar *branch;\n+\tconst char *at = strchr(name, '@');\n \tstruct commit_reflog *commit_reflog;\n \tenum selector_type selector = SELECTOR_NONE;\n \ndiff --git a/scalar.c b/scalar.c\nindex c9df9348ec..4efb6ac36d 100644\n--- a/scalar.c\n+++ b/scalar.c\n@@ -393,7 +393,7 @@ static int delete_enlistment(struct strbuf *enlistment)\n {\n \tstruct strbuf parent = STRBUF_INIT;\n \tsize_t offset;\n-\tchar *path_sep;\n+\tconst char *path_sep;\n \n \tif (unregister_dir())\n \t\treturn error(_(\"failed to unregister repository\"));\ndiff --git a/strbuf.c b/strbuf.c\nindex 59678bf5b0..3939863cf3 100644\n--- a/strbuf.c\n+++ b/strbuf.c\n@@ -1119,6 +1119,6 @@ void strbuf_stripspace(struct strbuf *sb, const char *comment_prefix)\n \n void strbuf_strip_file_from_path(struct strbuf *sb)\n {\n-\tchar *path_sep = find_last_dir_sep(sb->buf);\n+\tconst char *path_sep = find_last_dir_sep(sb->buf);\n \tstrbuf_setlen(sb, path_sep ? path_sep - sb->buf + 1 : 0);\n }\ndiff --git a/string-list.c b/string-list.c\nindex 08dc00984c..7c34a425da 100644\n--- a/string-list.c\n+++ b/string-list.c\n@@ -327,7 +327,7 @@ static int split_string(struct string_list *list, const char *string, const char\n \t\tBUG(\"string_list_split() called without strdup_strings\");\n \n \tfor (;;) {\n-\t\tchar *end;\n+\t\tconst char *end;\n \n \t\tif (flags & STRING_LIST_SPLIT_TRIM) {\n \t\t\t/* ltrim */\ndiff --git a/t/unit-tests/clar/clar/print.h b/t/unit-tests/clar/clar/print.h\nindex 6a2321b399..59b7dc14a1 100644\n--- a/t/unit-tests/clar/clar/print.h\n+++ b/t/unit-tests/clar/clar/print.h\n@@ -127,7 +127,7 @@ static void clar_print_tap_error(int num, const struct clar_report *report, cons\n \n static void print_escaped(const char *str)\n {\n-\tchar *c;\n+\tconst char *c;\n \n \twhile ((c = strchr(str, '\\'')) != NULL) {\n \t\tprintf(\"%.*s\", (int)(c - str), str);\ndiff --git a/transport.c b/transport.c\nindex c7f06a7382..845fd441be 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -1657,7 +1657,7 @@ int transport_disconnect(struct transport *transport)\n  */\n char *transport_anonymize_url(const char *url)\n {\n-\tchar *scheme_prefix, *anon_part;\n+\tconst char *scheme_prefix, *anon_part;\n \tsize_t anon_len, prefix_len = 0;\n \n \tanon_part = strchr(url, '@');\ndiff --git a/wrapper.c b/wrapper.c\nindex b794fb20e7..16f5a63fbb 100644\n--- a/wrapper.c\n+++ b/wrapper.c\n@@ -115,7 +115,7 @@ void *xmemdupz(const void *data, size_t len)\n \n char *xstrndup(const char *str, size_t len)\n {\n-\tchar *p = memchr(str, '\\0', len);\n+\tconst char *p = memchr(str, '\\0', len);\n \treturn xmemdupz(str, p ? p - str : len);\n }\n \n-- \n2.53.0\n\n"},{"id":"535290","messageId":"8d188ce1b8994f0108b49a4cad8af425b09504fd.1770342268.git.collin.funk1@gmail.com","threadId":"64922","inReplyTo":"a53fd33b5696487f941faace90f51153555ce8f4.1770342268.git.collin.funk1@gmail.com","subject":"[PATCH v2 2/2] gpg-interface: remove an unnecessary NULL initialization","fromName":"Collin Funk","fromEmail":"collin.funk1@gmail.com","sentAt":"2026-02-06T01:46:10Z","receivedAt":"2026-02-06T01:47:20Z","isPatch":true,"sender":{"key":"collin.funk1@gmail.com","avatar":"https://avatars.githubusercontent.com/u/65689063?v=4"},"body":"We assign this variable unconditionally, so we do not need to assign it\nto NULL where it is declared.\n\nSigned-off-by: Collin Funk <collin.funk1@gmail.com>\n---\n gpg-interface.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 377c0cf49f..87fb6605fb 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -398,7 +398,7 @@ static void parse_ssh_output(struct signature_check *sigc)\n {\n \tconst char *line, *principal, *search;\n \tchar *to_free;\n-\tconst char *key = NULL;\n+\tconst char *key;\n \n \t/*\n \t * ssh-keygen output should be:\n-- \n2.53.0\n\n"},{"id":"535291","messageId":"xmqq343ek4y6.fsf@gitster.g","threadId":"64922","inReplyTo":"8d188ce1b8994f0108b49a4cad8af425b09504fd.1770342268.git.collin.funk1@gmail.com","subject":"Re: [PATCH v2 2/2] gpg-interface: remove an unnecessary NULL initialization","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-06T01:59:13Z","receivedAt":"2026-02-06T01:59:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Collin Funk <collin.funk1@gmail.com> writes:\n\n> We assign this variable unconditionally, so we do not need to assign it\n> to NULL where it is declared.\n\nThe latter \"assign\" is better phrased as \"initialize\", but other\nthan that this looks great.\n\nThanks.\n\n\n>\n> Signed-off-by: Collin Funk <collin.funk1@gmail.com>\n> ---\n>  gpg-interface.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/gpg-interface.c b/gpg-interface.c\n> index 377c0cf49f..87fb6605fb 100644\n> --- a/gpg-interface.c\n> +++ b/gpg-interface.c\n> @@ -398,7 +398,7 @@ static void parse_ssh_output(struct signature_check *sigc)\n>  {\n>  \tconst char *line, *principal, *search;\n>  \tchar *to_free;\n> -\tconst char *key = NULL;\n> +\tconst char *key;\n>  \n>  \t/*\n>  \t * ssh-keygen output should be:\n"},{"id":"535352","messageId":"BC960E5D-2958-4680-A003-21BC24B8C5E1@gmail.com","threadId":"64922","inReplyTo":"a53fd33b5696487f941faace90f51153555ce8f4.1770342268.git.collin.funk1@gmail.com","subject":"Re: [PATCH v2 1/2] global: constify some pointers that are not written to","fromName":"Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2026-02-06T15:54:35Z","receivedAt":"2026-02-06T15:54:47Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"\n> Le 5 févr. 2026 à 20:50, Collin Funk <collin.funk1@gmail.com> a écrit :\n> \n> ﻿This v2 just moves the unrelated change mentioned in review to a\n> separate patch.\n> \n> -- 8< --\n> \n> The recent glibc 2.43 release had the following change listed in its\n> NEWS file:\n\n[snip]\n\nYou can also put notes after the (first) triple-dash in the patch itself :)"}]}