This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/7508] GCC refuses to compile a declartion right after a 'case' in switch
- From: "price at ifa dot hawaii dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Sep 2005 18:44:39 -0000
- Subject: [Bug c/7508] GCC refuses to compile a declartion right after a 'case' in switch
- References: <20020806093602.7508.ddcc@email.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From price at ifa dot hawaii dot edu 2005-09-15 18:44 -------
To get it to compile, use curly brackets after the "case":
case 1:
{
int y = 7;
}
I would suggest that the existence of several duplicates argue for a clearer
error message.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7508