Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

falls through with other comments #1660

Closed
ichernev opened this issue May 6, 2014 · 3 comments
Closed

falls through with other comments #1660

ichernev opened this issue May 6, 2014 · 3 comments

Comments

@ichernev
Copy link

ichernev commented May 6, 2014

I had something like this in my code and it failed to detect /* falls through */.

case 1:
case 2:
    doStuff();
    /* falls through */
// greater than 3
case 3:
case 4:
    doMoreStuff();

If I switch the order of the two comments it works:

case 1:
case 2:
    doStuff();
// greater than 3
    /* falls through */
case 3:
case 4:
    doMoreStuff();

But that's pretty ugly, IMHO :) So it would be really nice if /* falls through */ is detected after the last expression, not before the next case

@valueof
Copy link
Member

valueof commented May 7, 2014

You can put // greater than 3 after case 3: on the same line?

@ichernev
Copy link
Author

ichernev commented May 8, 2014

You're right. But I still think it reads better on top. Should I attempt a PR?

@valueof
Copy link
Member

valueof commented May 8, 2014

Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants