hsutter / cppfront

A personal experimental C++ Syntax 2 -> Syntax 1 compiler
Other
5.46k stars 238 forks source link

CI: Enable pedantic warnings and treat all warnings as errors #911

Closed DyXel closed 9 months ago

DyXel commented 9 months ago

This PRs makes the CI workflows fail if the compiler emits warnings for cppfront code (by using -Werror on clang/gcc and -WX on MSVC), it also adds -pedantic to clang/gcc to catch additional oversights.

Separately, I provide narrowing conversion "fixes", but I am not too fond of this commit, since it feels like the correct thing to do would be to promote int to whatever std::ssize returns in most places, I didn't do that yet as I believe this requires more thought on the design of the compiler's code and want feedback first. The commit could be skipped and done by someone else, or the warning could be disabled (seen that in lots of projects 😛).

hsutter commented 9 months ago

Thanks!

FWIW two flags I use on GCC and Clang that I don't think are included under the other options: -Wold-style-cast -Wunused-parameter

DyXel commented 9 months ago

FWIW two flags I use on GCC and Clang that I don't think are included under the other options: -Wold-style-cast -Wunused-parameter

-Wold-style-cast is already there, -Wunused-parameter is not, feel free to add though!