php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63130 "cannot allocate an array of constant size 0" or "dllimport not allowed"
Submitted: 2012-09-21 11:55 UTC Modified: 2012-10-01 13:25 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: gospodin dot p dot zh at gmail dot com Assigned: ab (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.3Git-2012-09-21 (snap) OS: Windows
Private report: No CVE-ID: None
 [2012-09-21 11:55 UTC] gospodin dot p dot zh at gmail dot com
Description:
------------
#include <iostream>
//#include "php_test_empty.h"
#include "targetver.h"
#include "php.h"

------------
>c:\program files (x86)\microsoft visual studio 9.0\vc\include\sys\stat.inl(44) 
: error C2466: невозможно выделить память для массива постоянного нулевого 
размера
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\sys\stat.inl(49) 
: error C2466: невозможно выделить память для массива постоянного нулевого 
размера
1>c:\program files (x86)\microsoft visual studio 
9.0\vc\include\sys\utime.inl(39) : error C2466: невозможно выделить память для 
массива постоянного нулевого размера
1>c:\program files (x86)\microsoft visual studio 
9.0\vc\include\sys\utime.inl(44) : error C2466: невозможно выделить память для 
массива постоянного нулевого размера
1>c:\program files (x86)\microsoft visual studio 
9.0\vc\include\sys\utime.inl(49) : error C2466: невозможно выделить память для 
массива постоянного нулевого размера
1>c:\program files (x86)\microsoft visual studio 
9.0\vc\include\sys\utime.inl(78) : error C2466: невозможно выделить память для 
массива постоянного нулевого размера

----------
means "cannot allocate an array of constant size 0"

DO SOMETHING FINALLY!!!!!!!11111oneone
MS Visual Studio 2005 don't exists any more. Make your sources up to date with 
IDE with less spaghetti-code. 

Expected result:
----------------
i've expected to make an extension which can use <string> and <iostream>

Actual result:
--------------
"cannot allocate an array of constant size 0"
or 
"definition dllimport not allowed"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-21 12:53 UTC] laruence@php.net
here is a tricky way to fix this, please try with it:

vi {THE VS INSTALL FODLER}\vc\include\malloc.h 

change the line:
#define _STATIC_ASSERT(expr) typedef char __static_assert_t[ (expr) ]  

to:

#ifdef PHP_WIN32  
#define _STATIC_ASSERT(expr) typedef char __static_assert_t[ (expr)?(expr):1 ]  
#else  
#define _STATIC_ASSERT(expr) typedef char __static_assert_t[ (expr) ]  
#endif
 [2012-09-21 13:18 UTC] gospodin dot p dot zh at gmail dot com
<i>[2012-09-21 12:53 UTC] laruence@php.net
here is a tricky way to fix this, please try with it: </i>
----------------------
IMPOSIBRU!!1 This worked fine! Thanks a lot! I've spend 2 days trying to solve one 
of those errors. Finally i can go on writing extension which can give me the only 
instance of COM connection to third part application on apache server, available 
and same for each web-site user (session).
 [2012-10-01 13:25 UTC] ab@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2012-10-01 13:25 UTC] ab@php.net
this looks like solved :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 11:01:31 2024 UTC