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

Curly braces inside braced-group throws ParseError #519

Closed
leventeBajczi opened this issue Oct 26, 2023 · 2 comments
Closed

Curly braces inside braced-group throws ParseError #519

leventeBajczi opened this issue Oct 26, 2023 · 2 comments

Comments

@leventeBajczi
Copy link

The following code compiles with gcc -std=c99, but pycparser throws a ParseError, complaining about the { token:

int main(){
   int a = ({1;});
}

Such constructs are used in some tasks of SV-COMP (example), and therefore pycparser cannot be used for such tasks.

Would it be possible to support such constructs in pycparser easily?

@eliben
Copy link
Owner

eliben commented Oct 28, 2023

It seems like a GNU extension to me, which pycparser doesn't support. Are you sure this syntax is part of the ISO C standard?

@leventeBajczi
Copy link
Author

Ah, my bad, I forgot to test with the -pedantic flag, which causes the error message warning: ISO C forbids braced-groups within expressions to appear. I guess this answers my original concern, so I'm closing the issue.

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