zyedidia / micro

A modern and intuitive terminal-based text editor

Home Page:https://micro-editor.github.io

Repository from Github https://github.comzyedidia/microRepository from Github https://github.comzyedidia/micro

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

jxu opened this issue · comments

commented

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.

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.

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

commented

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