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

Labels at the end of compound statements #484

Open
nxmaintainer opened this issue Dec 30, 2022 · 1 comment
Open

Labels at the end of compound statements #484

nxmaintainer opened this issue Dec 30, 2022 · 1 comment

Comments

@nxmaintainer
Copy link

This sample would be incorrect in C++, iirc, but it is valid in modern C (sorry, I can't find the standard version when it was added first):

int main(void) {
    switch(0) {
        case 0: {
            if (1) {
                goto label;
            }
        label:
        }
    }
}

gcc works properly even w/ -std=c99 (clang fails, but looks like it's possible to fix w/ proper flags), pycparser fails with ParseError: before: }

@eliben I'm not sure if you want to support this feature, but I'd really appreciate an advice. Will try to workaround during the preprocessing stage, label:; should help here, probably.

@eliben
Copy link
Owner

eliben commented Jan 7, 2023

I'll be happy to review a concrete PR that fixes this

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

2 participants