From:             ben dot yan at msn dot com
Operating system: Windows
PHP version:      5.2.0RC5
PHP Bug Type:     Compile Failure
Bug description:  Compile failure with the compiler of VC++ 2005 

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 bug report at http://bugs.php.net/?id=39130&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39130&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39130&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39130&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39130&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39130&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39130&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39130&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39130&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39130&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39130&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39130&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39130&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39130&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39130&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39130&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39130&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39130&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39130&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39130&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39130&r=mysqlcfg

Reply via email to