------- Comment #3 from aapo dot rantalainen at gmail dot com 2009-07-08 19:36 ------- Above code doesn't compile: int main(int argc, char *argv[]) { int a=1; switch (a) { case 1: int b=2; break; } return 0; }
Error "a label can only be part of a statement and a declaration is not a statement" Same workaround: add ; before int b=2; gcc -v Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.3-5ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37231