Subject: Re: [PATCH 3/5] parseopt: autocorrect mistyped subcommands

From: Junio C Hamano <[email-masked]>
Date: Sun, 08 Mar 2026 17:04:49 -0700

Jiamu Sun <[email-masked]> writes:

> +static const char *autocorrect_subcmd(const char *cmd,
> +				      struct string_list *cmds)
> +{
> +	struct autocorr autocorr = { 0 };
> +
> +	autocorr_resolve(&autocorr);
> +
> +	if (autocorr.mode == AUTOCORR_NEVER ||
> +	    autocorr.mode == AUTOCORR_HINTONLY)
> +		return NULL;
> +
> +	unsigned int min = -1;
> +	unsigned int ties = 0;
> +	struct string_list_item *cand;
> +	struct string_list_item *best = NULL;

CodingGuidelines: -Wdeclaration-after-statement is here.

Using "-1" as "the maximum value this unsigned type can represent"
is somewhat misleading.  Can't we avoid that?