From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12932 invoked by alias); 6 Aug 2002 18:56:01 -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 12918 invoked by uid 71); 6 Aug 2002 18:56:00 -0000 Date: Tue, 06 Aug 2002 11:56:00 -0000 Message-ID: <20020806185600.12917.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Joseph S. Myers" Subject: Re: c/7508: GCC refuses to compile a declartion right after a 'case' in switch Reply-To: "Joseph S. Myers" X-SW-Source: 2002-08/txt/msg00111.txt.bz2 List-Id: The following reply was made to PR c/7508; it has been noted by GNATS. From: "Joseph S. Myers" To: Cc: , Subject: Re: c/7508: GCC refuses to compile a declartion right after a 'case' in switch Date: Tue, 6 Aug 2002 19:53:58 +0100 (BST) On 6 Aug 2002 ddcc@email.com wrote: > GCC refuses to compile a declaration that follows immediately after a > 'case' in a 'switch', even in C99 mode: Although C99 allows declarations and statements to be mixed, it does not make declarations into statements. Labels can only be applied to statements, not to declarations. As to allowing this as an extension, see the comment in c-parse.in explaining why we don't: NOTE: we don't allow labels on declarations; this might seem like a natural extension, but there would be a conflict between attributes on the label and prefix attributes on the declaration. */ -- Joseph S. Myers jsm28@cam.ac.uk