08-04-2011, 01:02 PM
I don't believe my compiler's interpretation of rule 15.4 is consistent with the Standard's...
The Standard says:
is non-compliant, which seems reasonable. However, my compiler complains about:
Because 'x' is an enumerated type, I like to make it clear that we do_stuff for a particular subset of possible values.
What is intended interpretation of this rule? There is no explanation in the Standard.
Many thanks in advance for any comments.
Cheers,
Eddie.
The Standard says:
Code:
switch( x == 0 )
{
...
is non-compliant, which seems reasonable. However, my compiler complains about:
Code:
enum_type x;
switch( x )
{
case ENUM_A :
do_stuff;
break;
default :
/* No action */
break;
}
Because 'x' is an enumerated type, I like to make it clear that we do_stuff for a particular subset of possible values.
What is intended interpretation of this rule? There is no explanation in the Standard.
Many thanks in advance for any comments.
Cheers,
Eddie.