Re: [PATCH] run-command: fix an 'different modifiers' sparse warning
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 25, 2016, 20:20 UTC
- Message-ID
- <xmqqfuwgo83n.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <56CF576B.4020401@ramsayjones.plus.com>
Ramsay Jones <ramsay@ramsayjones.plus.com> writes:
Show 10 quoted lines
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> > --- > > Hi Jeff, > > If you need to re-roll your 'jk/epipe-in-async' branch, could you > please squash this into the relevant patch. (ie. "write_or_die: > handle EPIPE in async threads", 24-02-2016). > > Thanks!
I actually was planning to merge this to 'next' today, so I'll squash it in without waiting for a reroll.
By the way, doesn't it bother anybody to give two different types to the same function depending on NO_PTHREAD? It is not a new issue added by this series, but async_exit() that claims to return int does not (naturally) return anything, and sparse does not seem to care (neither do we).
Show 29 quoted lines
>
> ATB,
> Ramsay Jones
>
> run-command.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/run-command.c b/run-command.c
> index cd861bc..5dec18b 100644
> --- a/run-command.c
> +++ b/run-command.c
> @@ -625,7 +625,7 @@ int in_async(void)
> return !pthread_equal(main_thread, pthread_self());
> }
>
> -void async_exit(int code)
> +void NORETURN async_exit(int code)
> {
> pthread_exit((void *)(intptr_t)code);
> }
> @@ -675,7 +675,7 @@ int in_async(void)
> return process_is_async;
> }
>
> -int async_exit(int code)
> +int NORETURN async_exit(int code)
> {
> exit(code);
> }