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

Standard Conformance of different compilers #22

Open
wi-re opened this issue Nov 26, 2024 · 1 comment
Open

Standard Conformance of different compilers #22

wi-re opened this issue Nov 26, 2024 · 1 comment

Comments

@wi-re
Copy link
Collaborator

wi-re commented Nov 26, 2024

There are some non conformance related issues for different compilers, which is most notable with respect to designated initializers. These are a C++20 feature but have been supported in compilers for a long time, even in C++17 mode.

This means that you can write code in GCC that will compile and run correctly due to non standard conformance, but msvc will refuse to compile the same code due to stricter conformance rules.

For the future we should move to adding pedantic warnings (or even as errors).

On GCC this is either -Wpedantic or -Werror=pedantic. On MSVC this should be /permissive- . This should be platform portable though.

@wi-re
Copy link
Collaborator Author

wi-re commented Nov 26, 2024

Another feature that should be prohibited in the future are variable length arrays under gcc, even though noone should be using them in the first place (-Werror=vla)

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

1 participant