summaryrefslogtreecommitdiff
path: root/parse-options.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-12-11 15:35:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-12-12 08:21:33 (GMT)
commita92ec7efe0ad25f1c2047230c0324dcb54ce1cfc (patch)
tree0089c72cfbdf54da76582fc210048badce72071e /parse-options.h
parent6da2d9595161441cbed1b1f579b8dd46970a8e20 (diff)
downloadgit-a92ec7efe0ad25f1c2047230c0324dcb54ce1cfc.zip
git-a92ec7efe0ad25f1c2047230c0324dcb54ce1cfc.tar.gz
git-a92ec7efe0ad25f1c2047230c0324dcb54ce1cfc.tar.bz2
parse-options: fix SunCC compiler warning
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 <avarab@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options.h')
-rw-r--r--parse-options.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/parse-options.h b/parse-options.h
index dd14911..c433c42 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,