C++11 build fix for php/src/IcePHP/Init.cpp

rleighrleigh Member Roger LeighOrganization: University of DundeeProject: OMERO (Open Microscopy Environment)
This isn't an Ice bug, it's a bug in the PHP Zend headers, but which requires a workaround in Ice. See also
Debian #704791

This patch works around ZEND_BEGIN_ARG_INFO being broken by using ZEND_BEGIN_ARG_INFO_EX to provide non-broken values directly.
--- a/php/src/IcePHP/Init.cpp
+++ b/php/src/IcePHP/Init.cpp
@@ -22,10 +22,10 @@
 
 ZEND_DECLARE_MODULE_GLOBALS(ice)
 
-ZEND_BEGIN_ARG_INFO(Ice_initialize_arginfo, 1)
+ZEND_BEGIN_ARG_INFO_EX(Ice_initialize_arginfo, 1, ZEND_RETURN_VALUE, static_cast<zend_uint>(-1))
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO(Ice_createProperties_arginfo, 1)
+ZEND_BEGIN_ARG_INFO_EX(Ice_createProperties_arginfo, 1, ZEND_RETURN_VALUE, static_cast<zend_uint>(-1))
 ZEND_END_ARG_INFO()
 
 #define ICEPHP_COMMUNICATOR_FUNCTIONS \

Without this patch, it's not possible to build with a C++11 compiler, so it would be good if this or an equivalent solution could be implemented in a point release.


Thanks,
Roger

Comments

  • rleighrleigh Member Roger LeighOrganization: University of DundeeProject: OMERO (Open Microscopy Environment)
    Clarification

    Just to clarify, narrowing conversions are errors with C++11 where previously they were typically only warnings. That is, such conversions are not permitted to be implicit, which is why this patch introduces an explicit cast.
Sign In or Register to comment.