ID:               44355
 User updated by:  gk at gknw dot de
 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:      pajoye
 New Comment:

>From what I see the Metrowerks compiler is right when it finds a type
mismatch - what's wrong is that it errors out instead of only warn, but
unfortunately this cant the changed with a compiler switch.
Looking at ./Zend/zend_modules.h I see struct _zend_module_entry
declared as:
struct _zend_module_entry {
        unsigned short size;
        unsigned int zend_api;
        unsigned char zend_debug;
        unsigned char zts;
        struct _zend_ini_entry *ini_entry;
        struct _zend_module_dep *deps;
        char *name;
....

if I change the struct to use 'const zend_module_dep *':
--- zend_modules.h.orig Mon Dec 31 08:33:26 2007
+++ zend_modules.h      Fri Mar 07 20:10:34 2008
@@ -80,7 +80,7 @@
        unsigned char zend_debug;
        unsigned char zts;
        struct _zend_ini_entry *ini_entry;
-       struct _zend_module_dep *deps;
+       const struct _zend_module_dep *deps;
        char *name;
        struct _zend_function_entry *functions;
        int (*module_startup_func)(INIT_FUNC_ARGS);

then it works fine with unchanged exif.c extension; however sure it
breaks then with _every_ other module since none currently use 'const
zend_module_dep', at least not in PHP 5.2 source tree.
So if we want the modules use 'const zend_module_dep' then the header
zend_modules.h must also be changed, and it must be done for _all_
modules.


Previous Comments:
------------------------------------------------------------------------

[2008-03-07 18:57:19] [EMAIL PROTECTED]

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 ;)

------------------------------------------------------------------------

[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

Reply via email to