Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26508 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96380 invoked by uid 1010); 11 Nov 2006 01:14:06 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 96365 invoked from network); 11 Nov 2006 01:14:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Nov 2006 01:14:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=info@adaniels.nl; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=info@adaniels.nl; sender-id=unknown Received-SPF: error (pb1.pair.com: domain adaniels.nl from 82.94.235.198 cause and error) X-PHP-List-Original-Sender: info@adaniels.nl X-Host-Fingerprint: 82.94.235.198 hyak.bean-it.nl Received: from [82.94.235.198] ([82.94.235.198:44283] helo=hyak.bean-it.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/C0-20843-DD325554 for ; Fri, 10 Nov 2006 20:14:06 -0500 Received: from [127.0.0.1] (bean-it.xs4all.nl [213.84.27.165]) (authenticated bits=0) by hyak.bean-it.nl (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id kAB1DoL9016878 for ; Sat, 11 Nov 2006 02:13:53 +0100 Message-ID: <455523C4.70106@adaniels.nl> Date: Sat, 11 Nov 2006 02:13:40 +0100 User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Spam-Status: No, score=-2.6 required=4.0 tests=BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on hyak.bean-it.nl Subject: strange php_stream_from_zval requires return_value From: info@adaniels.nl (Arnold Daniels) Hi, I've noticed that building an extension will fail when using macro php_stream_from_zval and there is not return_value variable within the scope. /root/php-5.1.6/ext/hello/hello.c: In function `streamit': /root/php-5.1.6/ext/hello/hello.c:58: error: `return_value' undeclared (first use in this function) /root/php-5.1.6/ext/hello/hello.c:58: error: (Each undeclared identifier is reported only once /root/php-5.1.6/ext/hello/hello.c:58: error: for each function it appears in.) when building void streamit(zval * zstream TSRMLS_DC) { //zval *return_value; /* Will work if I uncomment this line */ php_stream *stream; php_stream_from_zval(stream, &zstream); php_stream_write(stream, "hello\n", 6); } PHP_FUNCTION(hello_stream) { zval *zstream; if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zstream)) return; streamit(zstream TSRMLS_CC); RETURN_TRUE; } When return_value is added, the function will work without a problem. I'm not sure whether this is bug or expected behavior and if I should use the bug reporting site or just post it here on the list. Anyhow it looks strange to me. Best regards, Arnold