ID:               46323
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Assigned
+Status:           Feedback
 Bug Type:         SimpleXML related
 Operating System: NetWare
 PHP Version:      5.2.7RC1
 Assigned To:      rrichards
 New Comment:

Why is nodeptr->ns->href being detected as const void * by CodeWarrior?

It is of cont xmlChar * (libxml tree.h).
Does it compile using the following?

xmlChar *href = nodeptr->ns ? nodeptr->ns->href : NULL;
_node_as_zval(sxe, nodeptr->parent, value, SXE_ITER_ATTRLIST, 
(char*)nodeptr->name, href, 0 TSRMLS_CC);



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

[2008-10-16 22:54:31] [EMAIL PROTECTED]

Description:
------------
compilation of simplexml for NetWare with CodeWarrior compiler breaks
because of different types without using a cast:

Compiling simplexml.c...
simplexml.c:1236: illegal implicit conversion from 'const void *' to
simplexml.c:1236: 'unsigned char *'

Errors caused tool to abort.
make: *** [release/simplexml.obj] Error 1
make: Leaving directory `C:/php5_test/php-5.2.7RC1/ext/simplexml'



Reproduce code:
---------------
compile...

Expected result:
----------------
compile doesnt break.

Actual result:
--------------
compile breaks.

suggested fix:
--- simplexml.c.orig    Thu Sep 11 16:23:34 2008
+++ simplexml.c Wed Oct 15 19:21:53 2008
@@ -1233,7 +1233,7 @@
                        if (nodeptr->type == XML_TEXT_NODE) {
                                _node_as_zval(sxe, nodeptr->parent, value, 
SXE_ITER_NONE, NULL,
NULL, 0 TSRMLS_CC);
                        } else if (nodeptr->type == XML_ATTRIBUTE_NODE) {
-                               _node_as_zval(sxe, nodeptr->parent, value, 
SXE_ITER_ATTRLIST,
(char*)nodeptr->name, nodeptr->ns ? nodeptr->ns->href : NULL, 0
TSRMLS_CC);
+                               _node_as_zval(sxe, nodeptr->parent, value, 
SXE_ITER_ATTRLIST,
(char*)nodeptr->name, nodeptr->ns ? (unsigned char*)nodeptr->ns->href :
NULL, 0 TSRMLS_CC);
                        } else {
                                _node_as_zval(sxe, nodeptr, value, 
SXE_ITER_NONE, NULL, NULL, 0
TSRMLS_CC);
                        }



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


-- 
Edit this bug report at http://bugs.php.net/?id=46323&edit=1

Reply via email to