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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 09:01:34 2025 UTC