From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0rc1) Gecko/20020417 Description of problem: The attached program compiles without warnings under gcc 3.1-0.25 but the executable segfaults immediately. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.gcc -W -Wall overflow.cpp -o overlflow 2../overflow 3. Actual Results: Segmentation fault Expected Results: An error during compile time about exceeding the maximum size of local variables. Additional info: void f() { int i[3000000]; i[0]=3; } int main(void) { f(); return 0; }
Er, what maximum size? It is a runtime thing, how can the compiler even guess it? Retry your program after ulimit -s 16384 and see how it works...