-
Notifications
You must be signed in to change notification settings - Fork 310
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
Add -Wconversion flag to protect future developments #1053
Add -Wconversion flag to protect future developments #1053
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A welcome addition! Thank you
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #1053 +/- ##
==========================================
- Coverage 34.61% 32.34% -2.27%
==========================================
Files 52 93 +41
Lines 2981 9793 +6812
Branches 1855 6599 +4744
==========================================
+ Hits 1032 3168 +2136
- Misses 310 777 +467
- Partials 1639 5848 +4209
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merci
@Mergifyio backport iron humble |
✅ Backports have been created
|
(cherry picked from commit 1b83a5b) # Conflicts: # transmission_interface/test/random_generator_utils.hpp
(cherry picked from commit 1b83a5b) # Conflicts: # controller_interface/CMakeLists.txt # controller_manager/CMakeLists.txt # hardware_interface/CMakeLists.txt # joint_limits/CMakeLists.txt # transmission_interface/CMakeLists.txt # transmission_interface/test/random_generator_utils.hpp
When working on
joint_limits
, I faced an issue with arclcpp::Duration
that I constructed using seconds and nanoseconds, but by mistake used afloat 0.005
for the seconds. Since the awaited arguments areints
, thefloat
conversion led to a NULL duration which I did not realize for a too long time.There was no compilation warning, as
-Wall
does not include-Wconversion
, supposedly to avoid too many warnings.With that flag the warning looks like this
I tested in
ros_control
package to add-Wconversion
compilation flag which created only 2 warnings, that could be easily fixed with explicit cast.Hence, for protecting future developments from risky mistakes with conversions, I suggest to add this flag in all packages of the repo. I will provide a similar PR for
ros2_controllers
that were definitively affected by exactly the same Time-at-zero issue.