gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re[2]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBo


From: Pascal J . Bourguignon
Subject: Re: Re[2]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?)
Date: Mon, 2 Feb 2004 21:43:18 +0100

Helge Hess writes:
> 
> Good point! Just checked the C99 draft:
>    http://www.vmunix.com/~gabor/c/draft.html#7.1.6
> 
> which indeed proves you right :-) NULL is not required to be defined as 0.

However, I don't know about C99 but IIRC, in C and C++, a null pointer
is equal to integer 0.

        char* p=NULL;
        assert(p==0);

That is, 0 represent the NULL pointer, even if char* p=0; and int i=0;
don't store the same bit pattern in p and i.

That's why I've forgotten NULL and  now I'm using 0 for a null pointer
(I met  some compiler making difficulties with  assigning or comparing
random pointers with NULL, never with 0).

-- 
__Pascal_Bourguignon__                     http://www.informatimago.com/
There is no worse tyranny than to force a man to pay for what he doesn't
want merely because you think it would be good for him.--Robert Heinlein
http://www.theadvocates.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]