-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Check for GCC/Clang compiler warnings in Ubuntu GitHub Actions CI #304
Check for GCC/Clang compiler warnings in Ubuntu GitHub Actions CI #304
Conversation
|
I've added it to the Lines 26 to 29 in 8a23e58
It will make it easier for us developers to run The only problem is that is |
Add a [`CMakePresets.json`][1] file that contains `ci-ubuntu` preset. This preset contains most of the recommended compiler warnings from the [`cmake-init`][2] project. However, I had to remove the `-Wdouble-promotion` and `-Werror=float-equal` flags since there are issues within the GTest headers. For compatibility with g++-7, `-Wextra-semi` was removed. I also had to remove some of the following flags like: `-fstack-protector-strong -fstack-clash-protection`. These flags cause errors in Clang v10 (still run in CI), and to be honest, with stuff like address sanitizer, we probably don't need them. [1]: https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html [2]: https://github.com/friendlyanon/cmake-init/blob/aa42211c79ab5117b05a2d9f795427f078a0a3d5/cmake-init/templates/common/CMakePresets.json#L88
8a23e58
to
209d67a
Compare
I've |
Before merging, is this the last PR in the row or is there something else to address? |
This is the last PR in the row. Every other PR I made was about fixing warnings. This PR is just here to make big red cross in GitHub Actions if any new code is added that has warnings in it. I considered doing something similar for Windows/MacOS, but I don't have easy access to a Windows/MacOS machine, so I guess that can wait until a Windows/MacOS user complains about warnings. I do also want to make a PR fixing the https://skypjack.github.io/uvw/ website (currently a lot of links don't work, since they point to https://skypjack.github.io/uvw/classuvw_1_1emitter.html, but the file is actually called https://skypjack.github.io/uvw/classuvw_1_1Emitter.html (e.g. with a capital
And no worries :) Thanks for reviewing stuff on your holiday! To be honest, I wouldn't have minded waiting. After all, since these PRs were mostly just refactoring PRs, there's probably no point in making a |
Add a
CMakePresets.json
file that containsci-ubuntu
preset. This preset contains most of the recommended compiler warnings from thecmake-init
project, with the following changes:-Wdouble-promotion
and-Werror=float-equal
flags since there are issues within the GTest headers.-Wextra-semi
was removed.-fstack-protector-strong -fstack-clash-protection
. These flags cause errors in Clang v10, and to be honest, with stuff like address sanitizer, we probably don't need them.I've also set the
"CMAKE_CXX_FLAGS_DEBUG": "-Werror"
variable when running onubuntu
in GitHub Actions. This will make theubuntu
build fail whenever any warnings are seen in the code, so you'll instantly spot it whenever somebody tries to add code that has warnings to this project. This should prevent issues like #294 from happening in the future.I've left this PR as a draft, since the CI currently fails, but after the following PRs are merged, this CI job should workAll of these PRs have now been merged, so CI passes:-Werror=unused
compiler error #296-Wshadow
warning #297-Wsign-conversion
in ip_addr() #298uvw::pipe_handle::connect()
-Wsign-conversion
warning #299-Wsign-conversion warning
#301test
directory #302~uv_type()
destructor protected #303