Skip to content

Conversation

@lukel97
Copy link
Contributor

@lukel97 lukel97 commented Dec 3, 2025

In GCC 15 the default C standard was changed to gnu23, so similar to #285 this explicitly sets -std=gnu17 on benchmarks that are known to fail to build with GCC 15 because of this.

Whilst we're here, this also goes through and replaces -std=X flags with the more CMake-native C_STANDARD property.

In GCC 15 the default C standard was changed to gnu23, so similar to llvm#285 this explicitly sets -std=gnu17 on benchmarks that are known to fail to build with GCC 15 because of this.

Whilst we're here, this also goes through and replaces -std=X flags with the more CMake-native C_STANDARD property.
@lukel97 lukel97 requested a review from asb December 3, 2025 12:02
@asb
Copy link

asb commented Dec 8, 2025

From what I can see in the CMake documentation, C_STANDARD or CXX_STANDARD will expand to -std={c,gnuc}NN or std={c++,gnuc++}NN depending on C_EXTENSIONS or CXX_EXTENSIONS (both defaulting to true). So unless I'm mistaken, some of these changes will be moving from std to the gnu language options.

I considered suggesting always explicitly defining C_EXTENSIONS or CXX_EXTENSIONS so it's easier to tell at a glance whether the gnu or standard version is being used, but the naming of the CMake property is so vague I'm not sure it would add a lot of clarity!

@lukel97
Copy link
Contributor Author

lukel97 commented Dec 9, 2025

From what I can see in the CMake documentation, C_STANDARD or CXX_STANDARD will expand to -std={c,gnuc}NN or std={c++,gnuc++}NN depending on C_EXTENSIONS or CXX_EXTENSIONS (both defaulting to true). So unless I'm mistaken, some of these changes will be moving from std to the gnu language options.

From what I understand both Clang and GCC (pre 15.0) default to -std=gnu17/gnu++17 so they already have the gnu extensions enabled: https://clang.llvm.org/docs/UsersManual.html#id77

Edit: Sorry I see now that you're talking about the changes that replace the explicit -std=X flags, good point. I'll remove those from this PR and maybe open another PR to move those over seeing as it's not the same thing, thanks for catching that.

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