Subject: Re: [PATCH] ppp: don't use 0 in pointer context

From: Rick Jones <[email-masked]>
Date: Wed, 08 Feb 2006 15:00:24 -0800

David S. Miller wrote:
> From: David Stevens <[email-masked]>
> Date: Wed, 8 Feb 2006 14:45:08 -0800
> 
> 
>>        Why would sparse complain about this? 0 is a well-defined
>>pointer value (the only value guaranteed to be by the language).
> 
> 
> Because sparse goes beyond the standards and tries to
> catch cases that usually end up being bugs.

So, how might it tell when someone is mistakenly using a pointer as a boolean if 
it takes a pass on if(foo) or if(!foo)  instead of looking for if(foo == NULL) 
or if(foo != NULL)?    (or I suppose if (NULL == foo) and if (NULL != foo))

it would seem that the compars with NULL, when read by pseudorandom folks would 
be more likely to reinforce that foo is a pointer rather than a boolean/flag.

rick jones