Remove -Werror from Clang compile options#220
Conversation
While useful, in my opinion it's not appropriate to set `-Werror` the `CMakeLists.txt`, instead allowing the user to set it if they wish, or setting it during CI if you want to catch warnings during testing. Signed-off-by: William Woodall <william@osrfoundation.org>
fujitatomoya
left a comment
There was a problem hiding this comment.
how about adding the code that suppress those warnings with this PR?
emersonknapp
left a comment
There was a problem hiding this comment.
Fair, but can we set it in CI here? I do prefer to put this setting on as a merge requirement to increase code quality.
I do that in internal packages by putting it in cmake - it forces devs to deal with it before getting tripped up by ci not passing when their local build does. It's maybe over strict but less experienced folks often get confused with the difference.
|
Pulls: #220 |
Sorry, I didn't follow up here sooner. I'll try to fix them and open a follow up pr. I do think merging this first makes sense because otherwise ros 2 cannot be compiled on macOS right now due just a warning. |
With CI I think you also want to avoid this flag because you want to see if it compiles and also collect all of the warnings. If you set this then it will stop at the first warning. We can configure CI to be yellow (or red for GitHub actions) if there are any warnings. We already do this with ci.ros2.org. Personally I think the only appropriate place for this flag is on a developer's shell. But I do understand why you do that in the cmake of other projects. |
|
And to be clear we normally don't merge anything with c++ warnings but we also only see this warning on macOS which we don't test in ci. |
Do you mean the first package within a larger multi-package build? That's a fair point, to let the full build tree of packages play out. Or is it the first source file compilation within a package build that has warnings, which will stop the make from continuing on to the rest? I know this is a tangent on this issue but I'll ask anyay: Like you suggest, the "error" case that I am really aiming at in a CI context is the aggregate result of "were there any compiler warnings", not necessarily that the first package/file failing should block everything else from building. Do you know the way get the warning info after the full colcon build is complete, to fail GitHub Action builds? It's not a workflow I have built/documented for https://github.com/ros-tooling/action-ros-ci |
Description
While useful, in my opinion it's not appropriate to set
-WerrortheCMakeLists.txt, instead allowing the user to set it if they wish, or setting it during CI if you want to catch warnings during testing.Is this user-facing behavior change?
No
Did you use Generative AI?
No
Additional Information
This is the warning that was being turned into an error by
-Werror:I'll perhaps fix that in a follow up pr.