php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #30155 make the header files ISO C99 and ISO C++ compatible
Submitted: 2004-09-19 17:03 UTC Modified: 2014-05-06 19:48 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: phoemix at harmless dot hu Assigned: levim (profile)
Status: Closed Package: *General Issues
PHP Version: 5.0.1 OS: Irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: phoemix at harmless dot hu
New email:
PHP Version: OS:

 

 [2004-09-19 17:03 UTC] phoemix at harmless dot hu
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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-05-06 19:45 UTC] levim@php.net
-Package: Feature/Change Request +Package: *General Issues
 [2014-05-06 19:48 UTC] levim@php.net
-Status: Open +Status: Closed -Operating System: * +Operating System: Irrelevant -Assigned To: +Assigned To: levim
 [2014-05-06 19:48 UTC] levim@php.net
I am fairly certain that you can now write an extension in C++ which seems to be the primary concern of this ticket.

The 64 bit integer types is being worked on; see https://wiki.php.net/rfc/size_t_and_int64_next
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 19 19:00:03 2025 UTC