Re: [patch] add G_GNUC_WARNUNCHECKED define
- From: Johannes Stezenbach <js convergence de>
- To: Owen Taylor <otaylor redhat com>
- Cc: Federico Mena Quintero <federico ximian com>, Arjan van de Ven <arjanv redhat com>, Sven Neumann <sven gimp org>, GTK+ development mailing list <gtk-devel-list gnome org>
- Subject: Re: [patch] add G_GNUC_WARNUNCHECKED define
- Date: Thu, 8 Jul 2004 13:10:26 +0200
On Thu, Jul 08, 2004 at 06:57:32AM -0400, Owen Taylor wrote:
> On Thu, 2004-07-08 at 06:51, Johannes Stezenbach wrote:
> >
> > G_CONST_RETURN is something entirely different from the
> > proposed G_GNUC_WARNUNCHECKED. It would have saved me quite
> > some time if the compiler had warned me that I forgot the
> > store the result of g_list_append().
>
> I was thinking of that, unfotunately, I don't think we can use
> it there because it is legitimate to ignore the return value
> of g_list_append() if you know the list already has at least
> one link.
Well, IMHO is is not legitimate to ignore the return value
of g_list_append() etc. because the documented API requires
that it is evaluated. OTOH I think it is not legitimate to
depend on undocumented implementation internals.
My guess is that adding G_GNUC_WARNUNCHECKED to the list functions
might uncover a few real bugs, and save people lots of time
in bug hunting.
Regards,
Johannes
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]