-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix test sources with latest cppcheck #6726
base: master
Are you sure you want to change the base?
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.
Thank you!
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.
Just something looking strange. I am surprised the tests passed.
src/webots/nodes/WbRobot.cpp
Outdated
@@ -270,7 +270,8 @@ void WbRobot::addDevices(WbNode *node) { | |||
if (!node) | |||
return; | |||
|
|||
if (node != this && dynamic_cast<const WbRobot *>(node)) | |||
const WbRobot *robotNode = dynamic_cast<const WbRobot *>(node); | |||
if (node != this && robrobotNodeot) |
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.
That looks wrong (typo)
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.
This a good catch
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.
Thank you for pointing this out
After reviewing the issue with latest cppcheck, I suggest not to make further changes at this time. Addressing the warnings would require adding const to a large number of methods, which involves verifying that each method does not modify any member variables of the passed object. While it would be possible to add |
Description
Fix cpp code to pass the test sources with latest cppcheck.
Tasks
Add the list of tasks of this PR.