Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22936 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5518 invoked by uid 1010); 24 Apr 2006 21:35:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 5503 invoked from network); 24 Apr 2006 21:35:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Apr 2006 21:35:31 -0000 X-PHP-List-Original-Sender: andrei@gravitonic.com X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.5 (sometimes 2.4) (4) Received: from ([204.11.219.139:53503] helo=lerdorf.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id B5/A5-19715-1A44D444 for ; Mon, 24 Apr 2006 17:35:30 -0400 Received: from [66.228.175.145] (borndress-lm.corp.yahoo.com [66.228.175.145]) (authenticated bits=0) by lerdorf.com (8.13.6/8.13.6/Debian-1) with ESMTP id k3OLZP82012645; Mon, 24 Apr 2006 14:35:25 -0700 Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: Content-Transfer-Encoding: 7bit Cc: Dmitry Stogov , "Frank M. Kromann" Date: Mon, 24 Apr 2006 14:34:44 -0700 To: PHP Internals X-Mailer: Apple Mail (2.623) Subject: ZSTR and NULL problems again From: andrei@gravitonic.com (Andrei Zmievski) 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