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

Improve support for __extension__ keyword #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MartinSpiessl
Copy link

This keyword is allowed to appear before expressions in GNU C and serves as a hint to the compiler to not issue a warning in case a GNU C specific extension is used, cf.:
https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html

The two additional parser rules in this commit will allow to parse that keyword correctly when it appears before an expression.

For now, the keyword is not reproduced when code is generated from the AST, but this should not be a problem as it is just controlling compiler warnings and does not affect semantics (as outlined above).


this PR will likely lead to an easy-to-solve merge conflict once PR #71 is merged. I would simply update this PR by rebasing in that case. Getting #71 merged first is my preferred order. I considered bundling both changes into one PR but they are really orthogonal and this did not feel right.

This keyword is allowed to appear before expressions in GNU C and
serves as a hint to the compiler to not issue a warning in
case a GNU C specific extension is used, cf.:
https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html

The two additional parser rules in this commit will allow to parse
that keyword correctly when it appears before an expression.

For now, the keyword is not reproduced when code is generated from
the AST, but this should not be a problem as it is just controlling
compiler warnings and does not affect semantics (as outlined above).
@inducer
Copy link
Owner

inducer commented Jan 2, 2023

I considered bundling both changes into one PR but they are really orthogonal and this did not feel right.

Sounds good. Thanks for making an effort to keep PRs small.

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

Successfully merging this pull request may close these issues.

2 participants