Re: [PATCH] Use NULL instead of integer 0 in security/selinux/

From: Richard B. Johnson
Date: Thu Jul 08 2004 - 06:18:42 EST


On Thu, 8 Jul 2004, Herbert Xu wrote:

> Chris Wright <chrisw@xxxxxxxx> wrote:
> > Fixup another round of sparse warnings of the type:
> > warning: Using plain integer as NULL pointer
>
> What's wrong with using 0 as the NULL pointer? In contexts where
> a plain 0 is unsafe, NULL is usually unsafe as well.
>
> Cheers,
> --

Because NULL is a valid pointer value. 0 is not. If you were
to make 0 valid, you would use "(void *)0", which is what
NULL just happens to be in all known architectures so far,
although that could change in an alternate universe.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips).
Note 96.31% of all statistics are fiction.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/