[lkml]   [2004]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Use NULL instead of integer 0 in security/selinux/
On Sat, Jul 10, 2004 at 03:39:13AM -0600, Eric W. Biederman wrote:
> I would agree that using the constant "0" in a pointer context
> when a more explicit NULL is bad form. But "0" is the one
> legal way in C to write the NULL pointer constant.

One reason I dislike the push to use NULL everywhere is that
new-comers may feel a false sense of security when using NULL.

This will bite in places where an explicit cast is needed to turn
NULL into a null pointer of the correct type, i.e., pointer arguments
to variadic functions.

A neat trick to catch such errors is to define NULL to be 0LL.
This is perfectly legal under ANSI and will generate a different
representation on i386.

Visit Openswan at
Email: Herbert Xu ~{PmV>HI~} <>
Home Page:
PGP Key:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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