bug-hurd
[Top][All Lists]
Advanced

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

Re: The patch of glibc which allows the user to override the pfinet serv


From: olafBuddenhagen
Subject: Re: The patch of glibc which allows the user to override the pfinet server
Date: Mon, 18 Aug 2008 17:05:24 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hi,

On Sun, Aug 17, 2008 at 01:57:18PM +0200, zhengda wrote:
> olafBuddenhagen@gmx.net wrote:

>> It really depends on the context. In some cases -- if the pointer is
>> dereferenced -- NULL will create an obvious failure, while some
>> random uninitialized pointer might be harder to track down.
>>
>> In other cases -- if it's used as argument to realloc(), free() etc.;
>> or if it's tested as a result from some other operation (getenv() in
>> this case) -- NULL will be treated as perfectly valid, and not give
>> any indication of failure at all!
>>
>> Thus I don't think it's good practice in general to initialize all
>> pointers to NULL...
>>   
> My first C language teacher told me to initialize all local variables,
> especially the pointers, I follow the rule, and sometimes it does give
> me some help:-)

Interesting...

Anyways, check how other parts of glibc handle this, and try to be
consistent :-)

-antrik-




reply via email to

[Prev in Thread] Current Thread [Next in Thread]