--- Comment #7 from alex dot pyattaev at gmail dot com 2010-05-09 10:29
---
I have encountered the bug with switch construct. And the problem is not the
error message, but the fact that it is still compiling just fine this code:
switch (chan_prop.model_type)
{
--- Comment #8 from manu at gcc dot gnu dot org 2010-05-09 15:26 ---
(In reply to comment #7)
There should be some consistency at least! I'd like to see this fixed
properly.
The compiler should be perfectly predictable, and not like Sorry, i don't
like
It is predictable: a label
--- Comment #9 from alex dot pyattaev at gmail dot com 2010-05-09 19:07
---
(In reply to comment #7)
I have encountered the bug with switch construct. And the problem is not the
error message, but the fact that it is still compiling just fine this code:
switch (chan_prop.model_type)
--- Comment #10 from dougsemler at gmail dot com 2010-05-09 23:25 ---
(In reply to comment #9)
A good example of seemingly normal code is following:
switch (whatever)
{
case 1:
int i=0;
i++;
--- Comment #11 from alex dot pyattaev at gmail dot com 2010-05-09 23:29
---
(In reply to comment #10)
(In reply to comment #9)
A good example of seemingly normal code is following:
switch (whatever)
{
case 1:
int i=0;
--- Comment #6 from manu at gcc dot gnu dot org 2009-07-09 09:25 ---
Is this mandated to be an error by the standard? Perhaps GCC could just pedwarn
and add the ';' itself, and compile just fine.
Otherwise, I might add a hint:
note: either add ';' or open a block after the label.
--- Comment #1 from paolo dot carlini at oracle dot com 2008-08-25 10:43
---
I think the improved error message in mainline makes clear this is invalid (the
EDG front-end agrees, by the way):
37231.c:6: error: a label can only be part of a statement and a declaration is
not a
--- Comment #2 from manu at gcc dot gnu dot org 2008-08-25 18:55 ---
I think this was fixed already in GCC 4.3.
--
manu at gcc dot gnu dot org changed:
What|Removed |Added