#288 3 dimensional array bug.

MinGW (57)

I just wanted to report a possible gcc bug
(both gcc 3.2 and 3.2.2 have a problem with the
following code).
The program below compiles ok (with no warnings).
But when you try to run it, you get a stack overflow.
Its very interesting that a[100][100][75] works, but
a[100][100][100] compiles ok but blows up when running.

I'm running this on a Pentium III 600 MHZ PC with 384
MB of Ram
running Windows 2000 Professional, so there should be
plenty of
RAM available to hold this 3 dimensional array.

#include <stdio.h>
int main()
long a[100][100][100]; /* 3 dimensional Array */
printf("\nHello World\n");
return 0;

Please Email me at:
william.sternbach@citigroup.com and also

Thank you

William Sternbach


  • Danny Smith

    Danny Smith - 2003-02-18

    Logged In: YES

    By default stack reserve is set to 2MB by ld.exe.
    Try setting stack reserve higher, eg,
    will get you 32MB stack reserve and the test will


  • Danny Smith

    Danny Smith - 2003-02-18
    • status: open --> closed-invalid

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks