Re: [PATCH] parse-options: fix sparse 'plain integer as NULL pointer'
Another thing from GitHub CI
https://github.com/git/git/actions/runs/24825391649/job/72659919418#step:9:144
Error: parse-options.c:680:30: comparison of integer expressions of
different signedness: 'unsigned int' and 'int' [-Werror=sign-compare]
680 | (n < cmds->nr && best == (intptr_t)cmds->items[n].util);
| ^~2026年4月24日(金) 1:05 Ramsay Jones <ramsay@ramsayjones.plus.com>:
Show 35 quoted lines
>
>
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
>
> Hi Jiamu Sun,
>
> If you need to re-roll your 'js/parseopt-subcommand-autocorrection'
> branch, could you please squash this into the patch corresponding
> to commit b9e6a2d30a ("parseopt: autocorrect mistyped subcommands",
> 2026-04-23).
>
> Thanks.
>
> ATB,
> Ramsay Jones
>
> parse-options.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/parse-options.c b/parse-options.c
> index d60e7bd3c9..14f3f385eb 100644
> --- a/parse-options.c
> +++ b/parse-options.c
> @@ -658,7 +658,7 @@ static const char *autocorrect_subcommand(const char *cmd,
>
> for_each_string_list_item(cand, cmds) {
> if (starts_with(cand->string, cmd)) {
> - cand->util = 0;
> + cand->util = NULL;
> } else {
> int edit = levenshtein(cmd, cand->string,
> 0, 2, 1, 3) + 1;
> --
> 2.54.0