[ccan] [PATCH] antithread: fix gcc 4.3 errors: control reaches end of non-void function

Rusty Russell rusty at rustcorp.com.au
Tue Feb 1 13:29:52 EST 2011


On Mon, 31 Jan 2011 11:41:33 pm Reini Urban wrote:
> 2011/1/31 Rusty Russell <rusty at rustcorp.com.au>:
> > On Mon, 31 Jan 2011 07:16:23 pm Reini Urban wrote:
> >> ---
> >>  ccan/antithread/antithread.c |    2 ++
> >>  1 files changed, 2 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/ccan/antithread/antithread.c b/ccan/antithread/antithread.c
> >> index 61b288a..430f617 100644
> >> --- a/ccan/antithread/antithread.c
> >> +++ b/ccan/antithread/antithread.c
> >> @@ -391,6 +391,7 @@ void *at_read(struct athread *at)
> >>       default:
> >>               /* Should never happen. */
> >>               err(1, "Short read from athread %p (pid %u)", at, at->pid);
> >> +             return NULL;
> >
> > Hi, what platform is this?
> >
> > Here it's marked as a noreturn function, so gcc knows it's not going to
> > return...
> 
> Ah sorry.
> gcc-4.3.4 cygwin
> 
> Probably the noreturn attribute is ignored here

Hmm, I'd guess that the err.h it's seeing doesn't have the annotation.

Can you send me (privately) the output of gcc -E on that file?  That
should tell me for sure.  A ccan/err module might be a good start.

I don't run cygwin, so I'm kind of working blind; your feedback is
greatly appreciated!!

Thanks,
Rusty.


More information about the ccan mailing list