From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3375 invoked by alias); 1 Dec 2005 12:32:09 -0000 Received: (qmail 3366 invoked by uid 48); 1 Dec 2005 12:32:08 -0000 Date: Thu, 01 Dec 2005 12:32:00 -0000 Message-ID: <20051201123208.3365.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/25181] [3.4 Regression] wrong "will never be executed" warning in switch - case block In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "oliverst at online dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2005-12/txt/msg00049.txt.bz2 List-Id: ------- Comment #5 from oliverst at online dot de 2005-12-01 12:32 ------- (In reply to comment #1) > This is invalid code: > t.cc: In function ‘int test_18()’: > t.cc:15: error: jump to case label > t.cc:9: error: crosses initialization of ‘int ret’ > t.cc:18: error: jump to case label > t.cc:9: error: crosses initialization of ‘int ret’ > > We should reject this. > Will you create a bug report for this or is there already one filed? I just tried it with GCC 4.0.2 (downloaded it from http://www.thisiscool.com/gcc_mingw.htm) and the code is still accepted. C:\MinGW_4.0.2\bin>gcc -v Using built-in specs. Target: i686-pc-mingw32 Configured with: /datal/gcc/gcc/configure --prefix=/datal/gcc/build/wingcc --bui ld=i686-pc-linux-gnu --host=i686-pc-mingw32 --target=i686-pc-mingw32 --enable-la nguages=c,c++,java --with-gcc --with-gnu-as --with-gnu-ld --with-as=/datal/gcc/b uild/crossgcc/bin/i686-pc-mingw32-as --with-ld=/datal/gcc/build/crossgcc/bin/i68 6-pc-mingw32-ld --enable-threads=win32 --disable-nls --disable-win32-registry -- disable-shared --disable-debug --without-newlib --enable-libgcj --disable-java-a wt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interprete r --enable-hash-synchronization --enable-sjlj-exceptions --enable-libgcj-multifi le --enable-libgcj-mingw-osapi=ansi Thread model: win32 gcc version 4.0.2 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25181