php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54328 $PHP_PREFIX/include/php/ext/standard/php_smart_str.h has error
Submitted: 2011-03-21 03:21 UTC Modified: 2011-03-21 03:33 UTC
From: zhangsilly at gmail dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.3.6 OS: Windows & Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: zhangsilly at gmail dot com
New email:
PHP Version: OS:

 

 [2011-03-21 03:21 UTC] zhangsilly at gmail dot com
Description:
------------
in the file $PHP_PREFIX/include/php/ext/standard/php_smart_str.h ,line 52, 
should have a pointer conversion.

now the code is below:

#define SMART_STR_DO_REALLOC(d, what) \
        (d)->c = SMART_STR_REALLOC((d)->c, (d)->a + 1, (what))

but any extensions include it cann't be compiled before change the code above 
like this, no matter the compiler is visual studio(2005 or 2008) or gcc:

#define SMART_STR_DO_REALLOC(d, what) \
        (d)->c = (char*) SMART_STR_REALLOC((d)->c, (d)->a + 1, (what))

everytime I change it myself.But event the newest PHP 5.3.6, the pointer 
conversion is still absent.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-21 03:33 UTC] cataphract@php.net
-Status: Open +Status: Bogus
 [2011-03-21 03:33 UTC] cataphract@php.net
SMART_STR_REALLOC expands to a function a function that returns void*. C (but not C++) allows conversion of void* to any pointer type, so the current code is correct. You're probably compiling your project as C++.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC