Subject: Re: [PATCH v3 01/42] parse-options: support --git-completion-helper

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Sun, 02 Dec 2018 14:41:46 +0100

On Fri, Feb 09 2018, Nguyễn Thái Ngọc Duy wrote:

> +static int show_gitcomp(struct parse_opt_ctx_t *ctx,
> +			const struct option *opts)
> +{

Says it returns 'static int'...

> [...]
> +	exit(0);

Then just exits...

> +		/* lone --git-completion-helper is asked by git-completion.bash */
> +		if (ctx->total == 1 && !strcmp(arg + 1, "-git-completion-helper"))
> +			return show_gitcomp(ctx, options);

This return value is never used.

Whine from SunCC (not fatal, also this was in v2.17.0 so no need to fix
before 2.20, just saw this now):

    "parse-options.c", line 520: warning: Function has no return
    statement : show_gitcomp