On Sun, 03 Jul 2011 02:07:48 +0100, Jérôme Loyet <jer...@loyet.net> wrote:
the warnings appear in sapis (cgi, fpm, ...) and extensions (standard,
...) and the problem comes from the XOffsetOf macro which is expanded
to offsetof defined in Zend/zend_operators.h whit the following code
added in revisions 311662 and 312264:
#ifndef offsetof
#define offsetof(t,f) \
((int)(&((t*)0)->f))
#endif
Yes, the cast should be changed to (size_t)(uintptr_t).
I have also hit this problem a month ago. At the time I think I commented
on IRC using (int)(intptr_t) instead could avoid problems like in "if
(offsetof(x) - 5 < 0)", but since the C standard calls for a «expand[ing]
to an integer constant expression that has type size_t»,
(size_t)(uintptr_t) seems preferable.
--
Gustavo Lopes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php