#44355 [Opn]: compilation breaks due illegal const usage
| From: | pajoye@php.net | Date: | Fri, 07 Mar 2008 18:57:19 +0000 |
| Subject: | #44355 [Opn]: compilation breaks due illegal const usage | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-123030@lists.php.net to get a copy of this message | ||
ID: 44355
Updated by: pajoye@php.net
Reported By: gk at gknw dot de
Status: Open
Bug Type: EXIF related
Operating System: NetWare
PHP Version: 5.2CVS-2008-03-06 (CVS)
-Assigned To:
+Assigned To: pajoye
New Comment:
Applied to 5.2 (and head) only for now. But this is a temporary fix.
The error returned on the Novell platform makes little sense. We can't
drop this const usage only because of Novell. We'll try to figure out
what's wrong and how to achieve the same thing and keep novell happy ;)
Previous Comments:
------------------------------------------------------------------------
[2008-03-06 22:31:31] gk at gknw dot de
Description:
------------
The NetWare compiler we use is very strict and breaks when const is
used where not expected. The commit:
http://cvs.php.net/viewvc.cgi/php-src/ext/exif/exif.c?r1=1.196&r2=1.197
breaks the NetWare compile due to the line:
static const zend_module_dep exif_module_deps[] = {
exif.c:258: illegal implicit conversion from 'const struct
exif.c:258: _zend_module_dep[2]' to
exif.c:258: 'struct _zend_module_dep *'
the patch below fixes this and also adds ifdefs as used with other
extensions f.e. pdp_*; not sure if these are really needed, but this
change:
-static const zend_module_dep exif_module_deps[] = {
+static zend_module_dep exif_module_deps[] = {
is definetely required.
--- exif.c.orig Mon Dec 31 08:33:29 2007
+++ exif.c Thu Mar 06 23:15:31 2008
@@ -242,19 +242,25 @@
/* }}} */
/* {{{ exif dependencies */
-static const zend_module_dep exif_module_deps[] = {
+#if ZEND_MODULE_API_NO >= 20050922
+static zend_module_dep exif_module_deps[] = {
ZEND_MOD_REQUIRED("standard")
#if EXIF_USE_MBSTRING
ZEND_MOD_REQUIRED("mbstring")
#endif
{NULL, NULL, NULL}
};
+#endif
/* }}} */
/* {{{ exif_module_entry
*/
zend_module_entry exif_module_entry = {
+#if ZEND_MODULE_API_NO >= 20050922
STANDARD_MODULE_HEADER_EX, NULL,
+#else
+ STANDARD_MODULE_HEADER,
+#endif
exif_module_deps,
"exif",
exif_functions,
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44355&edit=1