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

adding c_std=c2y option for clang #14174

Merged
merged 2 commits into from
Jan 26, 2025
Merged

Conversation

AzuxirenLeadGuy
Copy link
Contributor

Clang introduced a new standard for C: C2Y. It is available for clang 19 onwards. My commit is simple enough, just adding the std flag to the appropriate version. I did test this successfully on my machine with clang-19 installed, but it is my first commit here.

BTW: I just want to mention that I (coming from CMake) really like meson so much, and I am really grateful to all the wonderful people who are maintaining and have contributed to this project.

Signed-off-by: ajs <sam4lordjesus@outlook.com>
@theoparis
Copy link

Does c2y work with objective c? I was adding c23 support to meson for objective c but then I came across this PR and noticed it doesn't add anything to objc.py

Copy link
Collaborator

@thesamesam thesamesam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add this for GCC as well (for >=15.0.0).

@thesamesam
Copy link
Collaborator

Does c2y work with objective c? I was adding c23 support to meson for objective c but then I came across this PR and noticed it doesn't add anything to objc.py

For GCC trunk at least, yes. Seems fine for Clang too at a glance.

Signed-off-by: ajs <sam4lordjesus@outlook.com>
@AzuxirenLeadGuy
Copy link
Contributor Author

@thesamesam

Please add this for GCC as well (for >=15.0.0).

I hadn't checked the c2y status in gcc, and I just confirmed this by comparing the manuals for version 14 and version 15 . I could not test it because I didn't find any container for gcc 15 though. I feel it should surely run without exceptions. Anyone that have compiled gcc 15 in their machine can check this commit. I did test it with gcc 14 in my machine and it works as expected (c2y is not supported, and no other exception is thrown).

@AzuxirenLeadGuy
Copy link
Contributor Author

AzuxirenLeadGuy commented Jan 23, 2025

Does c2y work with objective c? I was adding c23 support to meson for objective c but then I came across this PR and noticed it doesn't add anything to objc.py

For GCC trunk at least, yes. Seems fine for Clang too at a glance.

For clang, the std list is defined again in the file objc.py, and that too goes only up to c17/gnu17. I am not sure why that is the case.

@thesamesam
Copy link
Collaborator

I'll test it with 15.

@thesamesam
Copy link
Collaborator

Given we have both #13642 and #14177, I wouldn't worry about the cleanup aspect.

@thesamesam
Copy link
Collaborator

I'll test it with 15.

Works, thanks.

@jpakkane jpakkane merged commit 79a87d5 into mesonbuild:master Jan 26, 2025
30 of 32 checks passed
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.

4 participants