[vlc-devel] commit: signals: Return NULL at SigThread end. (Pierre d'Herbemont )

Rémi Denis-Courmont remi at remlab.net
Fri Aug 21 08:32:48 CEST 2009


Le vendredi 21 août 2009 03:20:39 Pierre d'Herbemont, vous avez écrit :
> On Aug 21, 2009, at 1:13 AM, Rafaël Carré wrote:
> > On Fri, 21 Aug 2009 01:10:25 +0200 (CEST)
> >
> > git at videolan.org (git version control) wrote:
> >> vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Fri
> >> Aug 21 01:09:52 2009 +0200|
> >> [3c55f6d8bed88ca5635446cbc8ee1e85547c0ac1] | committer: Pierre
> >>
> >> +
> >> +    /* Not reached */
> >> +    return NULL;
> >
> > you can declare the function with __attribute__((noreturn)) and remove
> > the return
>
> The above solution is the most portable one, I think.

No. Some compilers generate warning on dead code, and some compilers generate 
warnings in both cases. There are no warning-free "portable" solutions. The 
only portable solution is to not turn warnings into errors. In fact, turning 
warnings into errors is not portable. Suck it up.

This is a stupid idea, even in debug mode. If you want to enable for yourself, 
it's your problem. On ARM Linux, I have unfixable warnings due to alignment vs 
cast problems. With threads cancellation, I also get dummy clobber warnings: 
the only solution would be to use "volatile" which is just worse than getting 
a warning, IMHO. We also have warnings due to unused results from glibc, in 
some cases where we actually know what we are doing.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list