This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Bug in C FE or difference between C & C++
- From: "Bingfeng Mei" <bmei at broadcom dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 2 Jun 2010 03:00:20 -0700
- Subject: Bug in C FE or difference between C & C++
Hi,
For the following simple example,
int main(void)
{
int a=0;
switch (a)
{
case 0:
int b=2;
break;
}
}
GCC will complain:
tst.c: In function 'main':
tst.c:7:6: error: a label can only be part of a statement and a declaration is not a statement
G++ will compile silently.
Is this a C FE bug or due to difference between C & C++?
Thanks,
Bingfeng