Re: [patch] add G_GNUC_WARNUNCHECKED define
- From: Federico Mena Quintero <federico ximian com>
- To: Owen Taylor <otaylor redhat com>
- Cc: Arjan van de Ven <arjanv redhat com>, GTK+ development mailing list <gtk-devel-list gnome org>
- Subject: Re: [patch] add G_GNUC_WARNUNCHECKED define
- Date: Wed, 07 Jul 2004 19:22:03 -0500
On Tue, 2004-07-06 at 08:43 +0200, Owen Taylor wrote:
> Another concern is that it isn't clear to me if we start adding this
> attribute where to stop. There are a *ton* of functions in GLib
> and GTK+ that return allocated memory. There are even more functions
> that have no side effects other than their return value. In either
> of these cases, not using the return value is definitely a bug.
>
> What's the criterion for adding the attribute, simply that we think
> it's likely that someone would make the mistake?
Isn't it enough of a rule to say that all functions that return new
references to objects or newly-allocated memory should be marked with
this attribute?
E.g. gtk_file_chooser_get_filename() would be one, but not
gtk_entry_get_text().
Federico
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]