Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22942 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27843 invoked by uid 1010); 25 Apr 2006 05:37:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 27828 invoked from network); 25 Apr 2006 05:37:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Apr 2006 05:37:16 -0000 X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:48682] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id FF/C2-19715-C85BD444 for ; Tue, 25 Apr 2006 01:37:16 -0400 Received: (qmail 30999 invoked from network); 25 Apr 2006 05:37:12 -0000 Received: from internal.zend.office (HELO thinkpad) (10.1.1.1) by internal.zend.office with SMTP; 25 Apr 2006 05:37:12 -0000 To: "'Andrei Zmievski'" , "'PHP Internals'" Cc: "'Frank M. Kromann'" Date: Tue, 25 Apr 2006 09:37:02 +0400 Message-ID: <000301c6682a$4b458440$6e02a8c0@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 Importance: Normal Subject: RE: ZSTR and NULL problems again From: dmitry@zend.com ("Dmitry Stogov") References: What was the problem with NULL_ZSTR? Dmitry. > -----Original Message----- > From: Andrei Zmievski [mailto:andrei@gravitonic.com] > Sent: Tuesday, April 25, 2006 1:35 AM > To: PHP Internals > Cc: Dmitry Stogov; Frank M. Kromann > Subject: ZSTR and NULL problems again > > > After Frank's latest changes, HEAD doesn't compile under gcc 2.95 > anymore: > > /homes/andrei/dev/php-src/ext/spl/spl_directory.c:1359: cast to union > type from type not present in union > > That line is: > > buf = php_stream_get_line(intern->u.file.stream, NULL, 0, > &line_len); > > Definition of php_stream_get_line(): > > #define php_stream_get_line(stream, buf, maxlen, retlen) > _php_stream_get_line((stream), IS_STRING, ZSTR(buf), (maxlen), 0, > (retlen) TSRMLS_CC) > > And under GCC ZSTR is defined as: > > typedef union _zstr { > char *s; > UChar *u; > void *v; > } zstr; > > #ifdef __GNUC__ > # define ZSTR(x) ((zstr)(x)) > # define NULL_ZSTR ZSTR((void*)NULL) > # define EMPTY_ZSTR ZSTR("\0\0") > > So, do we have to pass (void*)NULL everywhere now? Or can we > do this in > a cross-platform way somehow? > > -Andrei > > >