Description of problem: segmentation fault on this program "test.c": #include <stdio.h> int foo = 3; int main(void) { auto int bar(int); extern int foo; { int foo = 5; printf("foo is %d\n",foo); } bar(5); printf("foo is %d\n",foo); } void bar(void) { printf("i am bar\n"); } Version-Release number of selected component (if applicable): % gcc --version gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7) Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. How reproducible: easy as pie. Steps to Reproduce: 1. gcc test.c 2. 3. Actual results: % gcc test.c test.c: In function `bar': test.c:19: internal error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. Expected results: I think that line 7 should produce an error saying that local functions cannot have "auto" storage class. Additional info:
GCC supports an extension called nested functions, by which functions *can* have "auto" storage class. With gcc 3.2.3-20, we no longer ICE, generate no warning, which results in the rather obscure link error : undefined reference to `bar.0' Pushed upstream to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17807