From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8090 invoked by alias); 6 Aug 2002 16:36:05 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 8023 invoked by uid 71); 6 Aug 2002 16:36:04 -0000 Resent-Date: 6 Aug 2002 16:36:04 -0000 Resent-Message-ID: <20020806163604.8022.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, ddcc@email.com Received: (qmail 6800 invoked by uid 61); 6 Aug 2002 16:33:56 -0000 Message-Id: <20020806163356.6799.qmail@sources.redhat.com> Date: Tue, 06 Aug 2002 09:36:00 -0000 From: ddcc@email.com Reply-To: ddcc@email.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c/7508: GCC refuses to compile a declartion right after a 'case' in switch X-SW-Source: 2002-08/txt/msg00107.txt.bz2 List-Id: >Number: 7508 >Category: c >Synopsis: GCC refuses to compile a declartion right after a 'case' in switch >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Tue Aug 06 09:36:02 PDT 2002 >Closed-Date: >Last-Modified: >Originator: ddcc@email.com >Release: GCC 3.1.1 >Organization: >Environment: Seen on MinGW, but probably problem on all platforms >Description: GCC refuses to compile a declaration that follows immediately after a 'case' in a 'switch', even in C99 mode: int main() { int x = 1; switch (x) { case 1: int y = 7; } return 0; } Says GCC: In function `main': parse error before "int". However, if I add a dummy statement before the declaration, GCC compiles it fine: int main() { int x = 1; switch (x) { case 1: 4 + 5; int y = 7; } return 0; } >How-To-Repeat: Compile the first example in the report. >Fix: >Release-Note: >Audit-Trail: >Unformatted: