From a92ec7efe0ad25f1c2047230c0324dcb54ce1cfc Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Tue, 11 Dec 2018 16:35:01 +0100 Subject: parse-options: fix SunCC compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The compiler reports this because show_gitcomp() never actually returns a value: "parse-options.c", line 520: warning: Function has no return statement : show_gitcomp We could shut the compiler up. But instead let's not bury exit() too deep. Do the same as internal -h handling, return a special error code and handle the exit() in parse_options() (and other parse_options_step() callers) instead. Reported-by: Ævar Arnfjörð Bjarmason Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- parse-options.h | 1 + 1 file changed, 1 insertion(+) (limited to 'parse-options.h') diff --git a/parse-options.h b/parse-options.h index dd14911a29..c433c42828 100644 --- a/parse-options.h +++ b/parse-options.h @@ -197,6 +197,7 @@ extern int opterror(const struct option *opt, const char *reason, int flags); /*----- incremental advanced APIs -----*/ enum { + PARSE_OPT_COMPLETE = -2, PARSE_OPT_HELP = -1, PARSE_OPT_DONE, PARSE_OPT_NON_OPTION, -- cgit 1.2.3-korg