https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90632
--- Comment #1 from tangyixuan <tangyixuan at mail dot dlut.edu.cn> --- Hi: I think the superfluous error information of ‘a’ in the above code is fixed in gcc-trunk. $ gcc-trunk -c s.c s.c:1:13: error: expected ‘;’ before ‘static’ 1 | static int c | ^ | ; 2 | static int a = 0; | ~~~~~~ s.c: In function ‘main’: s.c:10:5: error: ‘c’ undeclared (first use in this function) 10 | c = func_1(a); | ^ s.c:10:5: note: each undeclared identifier is reported only once for each function it appears in $ gcc-trunk -version Target: x86_64-pc-linux-gnu Configured with: ../gcc-10-20191124/configure --prefix=/usr/local/gcc-20191124 --enable-checking=release --enable-languages=c,c++ --disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.0.0 20191124 (experimental) (GCC) Best regard