From: JClawson at tamu dot edu
Operating system: Fedora Core 2
PHP version: 5.0.4
PHP Bug Type: Compile Failure
Bug description: xml_element.c... my_free function doesn't work on GCC 4
Description:
------------
The my_free function macro in ext/xmlrpc/libxmlrpc/xml_element.c is poorly
written and results in invalid C code on line 192. Please remove this
macro completly from the file and write out the proper code for each case
the free() function is called.
/home/upgrade-tmp/php5-STABLE-200504211236/ext/xmlrpc/libxmlrpc/xml_element.c:
In function 'xml_elem_free_non_recurse':
/home/upgrade-tmp/php5-STABLE-200504211236/ext/xmlrpc/libxmlrpc/xml_element.c:192:
error: invalid lvalue in assignment
/home/upgrade-tmp/php5-STABLE-200504211236/ext/xmlrpc/libxmlrpc/xml_element.c:
In function 'xml_elem_entity_escape':
/home/upgrade-tmp/php5-STABLE-200504211236/ext/xmlrpc/libxmlrpc/xml_element.c:317:
warning: pointer targets in assignment differ in signedness
/home/upgrade-tmp/php5-STABLE-200504211236/ext/xmlrpc/libxmlrpc/xml_element.c:332:
warning: pointer targets in assignment differ in signedness
make: *** [ext/xmlrpc/libxmlrpc/xml_element.lo] Error 1
Reproduce code:
---------------
Here is the macro
#define my_free(thing) if(thing) {free(thing); thing = 0;}
This will not work on 192:
my_free((char*)root->name);
Expected result:
----------------
Consider changing the call on 192 from:
my_free((char*)root->name);
to:
if(root -> name)
{
free((char*)root->name);
root->name = 0;
}
--
Edit bug report at http://bugs.php.net/?id=32797&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32797&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32797&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32797&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32797&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32797&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32797&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32797&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32797&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32797&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32797&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32797&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32797&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32797&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32797&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32797&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32797&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32797&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32797&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32797&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32797&r=mysqlcfg