[610] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: Why g_print ?

daemon@ATHENA.MIT.EDU (Tim Janik)
Thu Jul 31 08:38:26 1997

From: Tim Janik <timj@psynet.net>
Date: Thu, 31 Jul 1997 13:50:56 +0200 (CEST)
To: gtk-list@redhat.com
In-Reply-To: <19970731111846.51535@isil.d.shuttle.de>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

On Thu, 31 Jul 1997, Werner Koch wrote:

> On Thu, Jul 31, 1997 at 04:38:13AM +0200, Tim Janik wrote:
> > regarding g_malloc(), g_free() and siblings, these functions are much safer
> > than thier libc equivalences. e.g. g_free() just returns if called with
> > NULL, i even rely on that behaviour in my apps.
>  ^^^^^
>  That's required by Standard C, see also free(3).

yup, you are right!

change the example to something like: e.g. g_malloc() always returns a pointer
to the allocated space, because g_error() is called if the request fails.
so the common programmer fault of not checking the return value of the
*alloc functions is avoided.

> Werner
>  

---
ciaoTJ

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post