David S. Miller wrote:
From: David Stevens <[EMAIL PROTECTED]>
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
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to