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

Update C++ linter to use gcc default version of C++ #3587

Closed
jxu opened this issue Dec 26, 2024 · 3 comments · Fixed by #2962
Closed

Update C++ linter to use gcc default version of C++ #3587

jxu opened this issue Dec 26, 2024 · 3 comments · Fixed by #2962

Comments

@jxu
Copy link

jxu commented Dec 26, 2024

Now that C++17 has been out for a while, I think it is a better default for the C++ linter to not force C++14 and instead use the system default. I'm on Ubuntu 22.04 and the system default C++ version is now c++17 (actually gnu++17).

makeLinter("g++", "c++", "gcc", {"-fsyntax-only","-std=c++14", "-Wall", "-Wextra", "%f"}, "%f:%l:%c:.+: %m")

I can submit a PR assuming it is just removing the flag from linter.lua.

@Andriamanitra
Copy link
Contributor

I think that would be good change, at this point defaulting to c++14 is just weird. The other option to consider would be to default to the latest C++ version so it at least never complains about valid code (because of backwards compatibility guarantees), but I think using the system default is more sensible as it doesn't need to be updated every time there's a new C++ version.

If users want to specify a certain C++ version they can add makeLinter() in their init.lua.

@JoeKar
Copy link
Collaborator

JoeKar commented Dec 27, 2024

This change was already recommended in #2962 too (see this comment).

@jxu
Copy link
Author

jxu commented Dec 28, 2024

Maybe if this PR is small it can be accepted quicker.

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 a pull request may close this issue.

3 participants