ID: 39130
Updated by: iliaa@php.net
Reported By: ben dot yan at msn dot com
-Status: Assigned
+Status: Feedback
Bug Type: Compile Failure
Operating System: Windows
PHP Version: 5.2.0RC5
Assigned To: wez
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2006-11-04 15:27:35] sailormax at inbox dot lv
I have same error while trying compile my module. With previous PHP all
was fine.
With 5.2.0 all fine too, if comment 2 lines at config.w32.h:
#define _USE_32BIT_TIME_T 1
#define HAVE_STDLIB_H 1
used VC++ 2005 Express Edition
------------------------------------------------------------------------
[2006-10-12 11:19:20] wez@php.net
I've seen this before; I think have the fix on a company laptop that is
currently occupied and I'll commit it just as soon as I can get access
to it again.
------------------------------------------------------------------------
[2006-10-12 08:28:29] edink@php.net
Wez, you added those lines for VC++ 2005 compability. Could you have a
look?
------------------------------------------------------------------------
[2006-10-11 18:29:43] ben dot yan at msn dot com
Description:
------------
Compile with VS.NET 2005
c:\program files\microsoft visual studio 8\vc\include\sys\stat.inl(44)
: error C2466: cannot allocate an array of constant size 0
c:\program files\microsoft visual studio 8\vc\include\sys\stat.inl(49)
: error C2466: cannot allocate an array of constant size 0
c:\program files\microsoft visual studio 8\vc\include\sys\utime.inl(39)
: error C2466: cannot allocate an array of constant size 0
c:\program files\microsoft visual studio 8\vc\include\sys\utime.inl(44)
: error C2466: cannot allocate an array of constant size 0
c:\program files\microsoft visual studio 8\vc\include\sys\utime.inl(49)
: error C2466: cannot allocate an array of constant size 0
c:\program files\microsoft visual studio 8\vc\include\sys\utime.inl(78)
: error C2466: cannot allocate an array of constant size 0
Reproduce code:
---------------
look the zend.h :
...
#include <stdio.h>
/*
* general definitions
*/
#ifdef ZEND_WIN32
# include "zend_config.w32.h"
# define ZEND_PATHS_SEPARATOR ';'
#elif defined(XXX)
...
#endif
Expected result:
----------------
Look the line 151 at the <../main/config.w32.h>:
/* vs.net 2005 has a 64-bit time_t. This will likely break
* 3rdParty libs that were built with older compilers; switch
* back to 32-bit */
#define _USE_32BIT_TIME_T 1
#define HAVE_STDLIB_H 1
so the config.w32.h should be included first. But it isn't so in the
zend.h:
#include <stdio.h>
/*
* general definitions
*/
#ifdef ZEND_WIN32
# include "zend_config.w32.h"
# define ZEND_PATHS_SEPARATOR ';'
#elif defined(XXX)
...
#endif
This would induce the compile error. and if
#include <stdio.h>
BEHIND the
#ifdef ZEND_WIN32
# include "zend_config.w32.h"
# define ZEND_PATHS_SEPARATOR ';'
#elif defined(XXX)
...
#endif
,it will be ok.
Actual result:
--------------
error C2466: cannot allocate an array of constant size 0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39130&edit=1