Re: return value checking for GTK APIs
- From: Olexiy Avramchenko <ath beast stu cn ua>
- To: brahmaiah vallabhaneni <vbrahmaiah yahoo com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: return value checking for GTK APIs
- Date: Wed, 25 Sep 2002 14:39:59 +0300
brahmaiah vallabhaneni wrote:
Hi All,
I am new to Linux GUI programming and started going
through the tutorial.
But I have observed one strange coding style (to me).
Usually, when we call a function say malloc, we
always validate the return value before it's use.
But in GTK samples, they do n't check the return
value of APIs. Any specific reason ?
If you're talking about g_malloc*() (or another functions based on it) -
yes,
there's one good reason - it will terminate your app with an error message
if memory allocation fail.
Olexiy
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]