[Spice-devel] [PATCH spice-gtk 1/4] coroutine: don't force coroutine_init checking

Marc-André Lureau mlureau at redhat.com
Tue Nov 19 08:05:13 PST 2013



----- Original Message -----
> On Tue, Nov 19, 2013 at 04:14:22PM +0100, Marc-André Lureau wrote:
> > Just like any other C function
> 
> NACK, I just added this annotation as not checking its return value will
> cause very hard to track down failures (no usable backtraces), so better to
> force it to be checked, especially as this is only used internally.

This is really different from any other C API.
If you want to warn, you can do so in init() or even more glib like, just abort.

> Christophe
> 
> > ---
> >  gtk/coroutine.h | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/gtk/coroutine.h b/gtk/coroutine.h
> > index ef6f3db..8d6c406 100644
> > --- a/gtk/coroutine.h
> > +++ b/gtk/coroutine.h
> > @@ -56,7 +56,8 @@ struct coroutine
> >  };
> >  
> >  #define IN_MAIN_CONTEXT (coroutine_self() == NULL ||
> >  coroutine_is_main_context(coroutine_self()))
> > -int coroutine_init(struct coroutine *co) G_GNUC_WARN_UNUSED_RESULT;
> > +
> > +int coroutine_init(struct coroutine *co);
> >  
> >  int coroutine_release(struct coroutine *co);
> >  
> > --
> > 1.8.3.1
> > 
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 


More information about the Spice-devel mailing list