Re: [PATCH] run-command: fix an 'different modifiers' sparse warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 25, 2016 at 12:20:12PM -0800, Junio C Hamano wrote:

> Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxxx> writes:
> 
> > Signed-off-by: Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxxx>
> > ---
> >
> > 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.

I am OK with that. But I do find it interesting that we must mark
NORETURN in both the declaration and the definition, but we don't for
__attribute__((format)).

> 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).

It would have bothered me if I had noticed. :)

It is simply a bug, and sparse (and the compiler) do not notice it
because it only shows up if you compile with NO_PTHREADS=1. And I think
it is added by this series:

> > @@ -675,7 +675,7 @@ int in_async(void)
> >  	return process_is_async;
> >  }
> >  
> > -int async_exit(int code)
> > +int NORETURN async_exit(int code)

The return value on this one should be "void", too, of course.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]