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/


Linus Torvalds wrote:

>
> I've seen too damn many people mistake NULL and NUL (admit it, you've seen
> it too), and I've seen code like
>
> char c = NULL;

THIS is simply a case of the programmer not understanding what NULL
means. When I use '0' for a pointer, I know EXACTLY what I mean, and I
also know when '0' might be ambiguous, and when I don't know what I'm
allowed to do, then I play it REALLY safe and typecast 0 to exactly the
pointer type I need.

I suppose it's good form to use the safest syntax in all cases. Good
for readability for people who need more redundancy to read the code.

Perhaps the Linux kernel should have a convention where all NULL
pointers are typecast explicitly. I can hear the cries of pain already. :)


-
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    [from the cache]
©2003-2011 Jasper Spaans