From: phoemix at harmless dot hu Operating system: * PHP version: 5.0.1 PHP Bug Type: Feature/Change Request Bug description: make the header files ISO C99 and ISO C++ compatible
Description: ------------ try to write an extension in C++ using the ISO C99 standard, gcc 3.3 or later is a good choice for compiler. Reproduce code: --------------- standard skeleton extension code as a C++ code Expected result: ---------------- build properly Actual result: -------------- 1) use "const char **(*aliases)" instead of "const char *(*aliases)[]" In file included from /usr/src/php-5.0.1/Zend/zend_globals.h:40, from /usr/src/php-5.0.1/Zend/zend_list.h:26, from /usr/src/php-5.0.1/Zend/zend_API.h:27, from /usr/src/php-5.0.1/main/php.h:38, from phpext/polylook.cc:6: /usr/src/php-5.0.1/Zend/zend_multibyte.h:45: error: ISO C++ forbids zero-size array `aliases' 2) use system-declared 64bit integer types instead of hacking some own types. where you have stdint.h use [u]int(8|16|32|64)_t instead of messing with (long )* int. these types are provided for using them. include stdint.h, and use int64_t and uin64_t instead of long long [int] /usr/src/php-5.0.1/main/snprintf.h:116: error: ISO C++ does not support `long long' /usr/src/php-5.0.1/main/snprintf.h:117: error: ISO C++ does not support `long long' 3) just remove the trailing coma /usr/src/php-5.0.1/main/streams/php_stream_filter_api.h:66: error: comma at end of enumerator list -- Edit bug report at http://bugs.php.net/?id=30155&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30155&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30155&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30155&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30155&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30155&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30155&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30155&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30155&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30155&r=support Expected behavior: http://bugs.php.net/fix.php?id=30155&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30155&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30155&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30155&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30155&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30155&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30155&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30155&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30155&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30155&r=mysqlcfg