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

Missing errors #53

Closed
rdebath opened this issue Mar 14, 2015 · 2 comments
Closed

Missing errors #53

rdebath opened this issue Mar 14, 2015 · 2 comments

Comments

@rdebath
Copy link

rdebath commented Mar 14, 2015

Minor one for now, this should generate a "duplicate case label" or similar error.

int
func(int n)
{
    switch (n) {
    case 2 + 2:
        return 1;
    case 4:
        return 2;
    }
    return 0;
}
@rui314
Copy link
Owner

rui314 commented Mar 16, 2015

Yup. Case labels are actually ranges because of GNU extension https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html, we need to also warn on something like 3 ... 7 and 5 ... 10.

@rui314
Copy link
Owner

rui314 commented Mar 16, 2015

Fixed in 1a4f625.

@rui314 rui314 closed this as completed Mar 16, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants