Does anyone know why this is not possible
- int main(void)
-
{
-
goto labelb;
-
labela:
-
{
-
int i = c;
-
goto labelc;
-
}
-
labelb:
-
enum { c = 0;}
-
goto labelb;
-
labelc:
-
;
-
}
and where in the c99 documentation it says this is not possible?
So does the checking only look for declarations by using abstract syntax tree and not in the control flow?
Thanks
Ok, first, AAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHH!
Now that that is out of my system, ;) if you ever use gotos on any of my projects without consent, I... will.... kill... you.... s...l...o...w...l...y. As slowly as it take to debug such crap. :D I'm serious. gotos are not needed except under
very exceptional circumstances.
Now that my rant is out of my system. It won't work because C/C++ is a declare before use language. 'c' was not declared prior to its use on line 6.
EDIT: and before you say "it was declared before use", I mean during parsing the code, not during execution flow.
Adrian