Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53728 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19144 invoked from network); 3 Jul 2011 01:07:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jul 2011 01:07:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=jerome@loyet.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jerome@loyet.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain loyet.net from 209.85.210.170 cause and error) X-PHP-List-Original-Sender: jerome@loyet.net X-Host-Fingerprint: 209.85.210.170 mail-iy0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:53344] helo=mail-iy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/71-29452-6E0CF0E4 for ; Sat, 02 Jul 2011 21:07:51 -0400 Received: by iym1 with SMTP id 1so4426043iym.29 for ; Sat, 02 Jul 2011 18:07:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.93.73 with SMTP id u9mr4102198ibm.155.1309655268296; Sat, 02 Jul 2011 18:07:48 -0700 (PDT) Received: by 10.231.192.132 with HTTP; Sat, 2 Jul 2011 18:07:48 -0700 (PDT) Date: Sun, 3 Jul 2011 03:07:48 +0200 Message-ID: To: php-dev Content-Type: text/plain; charset=ISO-8859-1 Subject: Compilation warning on offsetof in 5.4 and trunk From: jerome@loyet.net (=?ISO-8859-1?B?Suly9G1lIExveWV0?=) Hi, in 5.4 and trunk, there is compilation warnings all pointing to STD_PHP_INI_ENTRY /home/fat/dev/php-src/trunk/sapi/fpm/fpm/fpm_main.c:1465:109: warning: cast from pointer to integer of different size /home/fat/dev/php-src/trunk/sapi/fpm/fpm/fpm_main.c:1466:85: warning: cast from pointer to integer of different size 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 Before this addition, XOffsetOf was expanded to ((long) (((char *) (&(((t*)((void *)0))->f))) - ((char *) ((void *)0)))) which is defined at the end of main/php.h. Two questions: 1- is this possible to change Zend/zend_operators.h to use the old macros ? (short term solution) 2- Why not using the build-in POSIX offsetof (man offsetof) when available ? (long term solution) thx ++ jerome PS: i'm compiling on 64 bits linux