strange php_stream_from_zval requires return_value

From: Date: Sat, 11 Nov 2006 01:13:40 +0000
Subject: strange php_stream_from_zval requires return_value
Groups: php.internals 
Request: Send a blank email to internals+get-26508@lists.php.net to get a copy of this message
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

« previous php.internals (#26508) next »