Bug #44786 _INTEGRAL_MAX_BITS shouldn't be redefined (error C2466: cannot allocate an arr)
Submitted: 11 May 2009 12:40 Modified: 15 Jan 2013 7:05
Reporter: Andrii Nikitin Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.1.34 OS:Windows (32 bit)
Assigned to: CPU Architecture:Any

[11 May 2009 12:40] Andrii Nikitin
Description:
_INTEGRAL_MAX_BITS shouldn't be redefined in include/config-win.h , because its value is system-specific and should be 

According to msdn:

1. _INTEGRAL_MAX_BITS - Reports the maximum size (in bits) for an integral type.
http://msdn.microsoft.com/en-us/library/b0084kay(VS.80).aspx

2. Fundamental types in C++ are divided into three categories: integral, floating, and void. Integral types are capable of handling whole numbers.
http://msdn.microsoft.com/en-us/library/cc953fe1(VS.80).aspx

So, this symbol is predefined (in my understanding it is equal to 
sizeof(long long) or sizeof(__int64), if exists. 
Redefinition may result in complex problems.

E.g. on some Windows 32 (XP, 2003, 2008) installations I am getting many errors like:

Error	25	error C2466: cannot allocate an array of constant size 0	C:\Program Files\Microsoft Visual Studio 8\VC\include\sys\stat.inl	44	
Error	273	error C3861: '_wctime64': identifier not found	C:\Program Files\Microsoft Visual Studio 8\VC\include\wtime.inl	50	

Workaround: After wrapping line #66 in include/config-win.h
#define _INTEGRAL_MAX_BITS 32

with 
#ifndef _INTEGRAL_MAX_BITS
...

compilation goes smoothly.

How to repeat:
See MSDN with links above and include/config-win.h

Suggested fix:
Do not redefine _INTEGRAL_MAX_BITS
[27 Sep 2010 18:27] Konstantin Osipov
There is no config-win.h in 5.5.
[15 Jan 2013 7:05] Erlend Dahl
No longer reproducible.