1

Style50 is complaining about incorrect indentation when I'm trying to parse code containing empty cases inside a switch statement. Here's a code example:

 4 int main(void)
 5 {
 6     // code
 7     switch (x)
 8     {
 9         case 1:
10         case 2:
11         case 3:
12             // code
13             break;
14     }
15 }

And this is style50's answer:

:( 10  Incorrect indentation. Expected 12, found 8.
:( 11  Incorrect indentation. Expected 16, found 8.
:( 12  Incorrect indentation. Expected 20, found 12.

Would it really be considered good style to further indent lines 10 through 12, or is style50 wrong here?

1 Answer 1

1

It is anticipating that line 10 is the code for case1, in which case it should be indented. So I would ignore that error.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .