Re: Re: svn: /php/php-src/ branches/PHP_5_3/ext/date/php_date.c trunk/ext/date/php_date.c
| From: | Johannes Schlüter | Date: | Mon, 24 Jan 2011 19:21:19 +0000 |
| Subject: | Re: Re: svn: /php/php-src/ branches/PHP_5_3/ext/date/php_date.c trunk/ext/date/php_date.c | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-51349@lists.php.net to get a copy of this message | ||
On Mon, 2011-01-24 at 19:11 +0000, Gustavo Lopes wrote:
> Hum? Pierre's change is "correct", but it's also redundant.
>
> Please read the C FAQ: http://c-faq.com/null/ptrtest.html
>
> What would be invalid would be testing for a null pointer with something
> like this:
>
> void *p;
> ...
> int a = 0;
> if (p == (void*)a) { }
>
> Because "a" is not "a constant integer expression with value 0" (not to
> mention, integer to pointer conversions are implementation defined). A
> NULL pointer doesn't have to be represented with address 0x0, but a
> *constant* 0 is guaranteed to represent a NULL pointer constant.
Thanks for the link ... I initially thought this was the case, but
reading the standard made me believe otherwise, maybe I've got to
improve my reading skills :-)
johannes