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

From: Alexandre Oliva
Date: Sat Jul 10 2004 - 16:56:39 EST


On Jul 9, 2004, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:

> On Fri, Jul 09, 2004 at 09:43:18PM -0400, Kyle Moffett wrote:
>>
>> most clear? These are all "logically" correct, for the most part, but
>> as humans we have certain readability standards.

> Nope, B is undefined.

Nope, B is implementation-defined. The conversion from pointers to
integers is implementation-defined, and it's meant to be unsurprising
to those familiar with the architecture. I.e., if you can
zero-initialize a pointer and get a NULL pointer back, it's quite
likely that a NULL pointer will convert back to (int)0, even though
it's not required by the C Standard AFAICT.

>> int some_function(int a, void *b, char *c, unsigned char d, int e);

>> B) int res = some_function(NULL,NULL,NULL,NULL,NULL);

--
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/