Re: [PATCH] parse-options: fix SunCC compiler warning

2018-12-11 Thread Junio C Hamano
Duy Nguyen writes: > I have a better plan: stop exposing parse-options loop to outside. > What all these commands need is the ability to deal with unknown > options (or non-options in update-index case). They could register > callbacks to deal with those and keep calling parse_options() instead.

Re: [PATCH] parse-options: fix SunCC compiler warning

2018-12-11 Thread Duy Nguyen
On Tue, Dec 11, 2018 at 3:13 AM Junio C Hamano wrote: > > Duy Nguyen writes: > > > The reason it's in parse_options_step() is because -h is also handled > > in there. Although -h does not bury exit() deep in the call chain. So > > how about this as a replacement? > > So just like -h returns PARSE

Re: [PATCH] parse-options: fix SunCC compiler warning

2018-12-10 Thread Junio C Hamano
Duy Nguyen writes: > The reason it's in parse_options_step() is because -h is also handled > in there. Although -h does not bury exit() deep in the call chain. So > how about this as a replacement? So just like -h returns PARSE_OPT_HELP and causes the calling parse_options() to exit(129), the ne

Re: [PATCH] parse-options: fix SunCC compiler warning

2018-12-10 Thread Duy Nguyen
On Mon, Dec 10, 2018 at 03:36:54PM +0900, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > > > 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 > >

Re: [PATCH] parse-options: fix SunCC compiler warning

2018-12-09 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > 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 > > The function calls exit() and will never return. Update and mark it > NORETURN

[PATCH] parse-options: fix SunCC compiler warning

2018-12-09 Thread Nguyễn Thái Ngọc Duy
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 The function calls exit() and will never return. Update and mark it NORETURN. Reported-by: Ævar Arnfjörð Bjarmason Signe