Compiler won't let me nest switch statements with common labels inside
them (in the cases). Why is this a problem (either in terms of
standard or in terms of compiler's ability to make sense of it)?
ex:
typedef enum {ONE, TWO, THREE} TYPE; /* dumb use, but explains
situation */
TYPE var1, var2;
/* code that sets var1,var2 somehow */
switch(var1)
{
case ONE: /* code */
case TWO: /* code */
switch(var2)
{
case: ONE: /* code -- ! 1st complain ! */
case: TWO: /* code */
}
case THREE: /* code */
}
===========
compiler complains first about the ONE label being a "duplicate label"
and "previously defined here"
What's the reason for this?