On Wed, Feb 08, 2006 at 02:47:12PM -0800, 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.
Well to be frank the only significant NULL/0 bug that I know can't be caught by converting 0 to NULL anyway. The bug only exists on architectures where the representations of null-pointers of types are different. On those architectures, if you have something like int func(char *fmt, ...); ... func("foo", NULL); Then this may break if func actually expected a int * while NULL could be something different altogether. The only safe way to write this is to have func("foo", (int *)NULL); or func("foo", (int *)0); Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt - 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