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, Miles Bader wrote:

    > "David S. Miller" <davem@redhat.com> writes:
    > >> What's wrong with using 0 as the NULL pointer? In contexts where
    > >> a plain 0 is unsafe, NULL is usually unsafe as well.
    > >
    > > It's a general sparse cleanup people are doing across the entire tree.
    > > It's the "proper" way to do pointer comparisons post-K&R.
    >
    > But 0 in such a context isn't an integer, it's a pointer...

    No it's not.

    I'm sorry that you are such a K&R-C bigot that you don't like type
    checking. But the kernel DOES like type checking, and the kernel is not
    K&R C. The kernel uses strict ANSI, and in fact, is _more_ strict than
    ANSI C is in many many ways.

    One of the "strict typechecking" rules is that you don't mix integers and
    pointers by mistake. The fact that C allows dual usage of the integer "0"
    is an anachronism that should have been fixed long ago.

    Final word: K&R C without prototypes etc is still "legal C". That doesn't
    make it legal kernel code.

    Linus
    -
    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: 2009-11-18 23:46    [from the cache]
    ©2003-2014 Jasper Spaans. hosted at Digital Ocean