Re: [PATCH] Use NULL instead of integer 0 in security/selinux/

From: Alexandre Oliva
Date: Tue Jul 13 2004 - 22:16:43 EST


On Jul 11, 2004, Olaf Titz <olaf@xxxxxxxxxxxxxx> wrote:

> (Worse in C++ where usage of NULL is discouraged, I've always
> wondered about the reasons.)

FWIW, g++ defines NULL to the __null GCC-extension keyword, that
issues a warning if it's doesn't decay to a pointer type, but behaves
like the integral constant of value 0 otherwise, as required by the
C++ standard.

I suppose Linux might benefit from such an extension implemented in C
as well. Well, looks like sparse already takes care of that, and GCC
has entered an new-extension-avoidance mode (or mood? :-) a few years
ago.

--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/