-
Notifications
You must be signed in to change notification settings - Fork 112
Add compiler option -Wconversion and add explicit casts for conversions that may alter the value or change the sign #263
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
Conversation
…ns that may alter the value or change the sign Signed-off-by: Johannes Meyer <[email protected]>
jacobperron
left a comment
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.
jacobperron
left a comment
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.
Looks like clang is a bit more picky.
We can fix the two warnings in the tests, but I'm not sure what to do about the warnings coming from the gtest files. Maybe we can ignore them some way?
|
@meyerj Can you fix this additional warning on macOS: https://ci.ros2.org/job/ci_osx/9381/clang/fileName.-1409726512/ ? For the the warnings coming from gtest, I guess we should do something similar to |
… Clang See ros2#263 (comment). Signed-off-by: Johannes Meyer <[email protected]>
… Clang See ros2#263 (comment). Signed-off-by: Johannes Meyer <[email protected]>
0d8f39d to
7db43f8
Compare
Done in 7db43f8. By adding |
What if we just add |
|
err, sorry. I think you meant that the additional fixes in 7db43f8 aren't necessary with the warning suppression? |
They are not necessary to fix the build on macOS, but from #263 (comment) I understood that you asked me to fix them anyway, such that the only remaining sign conversion warnings would be produced by gtest and gmock. I always considered |
Understood, this is what I asked 👍
I agree, it is just a workaround to deal with the gtest/gmock errors. Sorry for the confusion. Thanks for iterating! |
Follow-up on #261 (comment).
I think most implicit conversions have been okay. But not checking the signed return value of
rcutils_vsnprintf()informat_string.ccould be considered a bug.