Re: [patch] add G_GNUC_WARNUNCHECKED define



On Thu, Jul 08, 2004 at 12:23:30PM +0200, Sven Neumann wrote:
> Hi,
> 
> Federico Mena Quintero <federico ximian com> writes:
> 
> > 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().
> 
> We already have G_CONST_RETURN to indicate this difference. Do you
> really want to clutter the API with G_GNUC_WARNUNCHECKED? I don't
> think that's a good idea in general even though it would certainly be
> correct.

I would agree that doing WARNUNCHECKED on almost all functions is a bit pointless, 
but on the other side of the equation, doing it on g_realloc() certainly
does make a lot of sense. I don't think anyone will forget to check the
return value of functions that have as goal to allocate something and return
it, esp if there are no other side effects, so adding this to those would be
unneeded clutter indeed. 
How much else is left, functions that have "desired" side effects but also
return something that has to be used ?

Attachment: pgpLK58gRcV3J.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]