[Top][All Lists]
[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/
- Re: Re[2]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), (continued)
- Re: Re[2]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Helge Hess, 2004/02/01
- Re: Re[2]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Leigh Smith, 2004/02/02
- Re: Re[2]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Helge Hess, 2004/02/02
- Re: Re[2]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Marco Scheurer, 2004/02/02
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), David Ayers, 2004/02/02
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Pascal J . Bourguignon, 2004/02/02
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool:?), Alexander Malmberg, 2004/02/03
- Re: [RFA]: BOOL coding standards (Was: Problem with+numberWithBool: ?), Alexander Malmberg, 2004/02/02
- Re: Re[2]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?),
Pascal J . Bourguignon <=
- Re: [RFA]: BOOL coding standards (Was: Problem with+numberWithBool: ?), Alexander Malmberg, 2004/02/02
Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Helge Hess, 2004/02/01
Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Helge Hess, 2004/02/01