Messages in this thread | | | Date | Thu, 8 Jul 2004 07:10:12 -0400 (EDT) | From | "Richard B. Johnson" <> | Subject | Re: [PATCH] Use NULL instead of integer 0 in security/selinux/ |
| |
On Thu, 8 Jul 2004, Herbert Xu wrote:
> Chris Wright <chrisw@osdl.org> 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |