lkml.org 
[lkml]   [2004]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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/

    \
     
     \ /
      Last update: 2005-03-22 14:04    [W:4.067 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site