Skip to content
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 some more clang compiler warnings #1712

Merged
merged 15 commits into from
Jan 26, 2023
Merged

Conversation

rhaschke
Copy link
Contributor

This depends on ament/googletest#21

@codecov
Copy link

codecov bot commented Nov 11, 2022

Codecov Report

Base: 50.42% // Head: 50.44% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (0dd9670) compared to base (4765028).
Patch coverage: 79.17% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1712      +/-   ##
==========================================
+ Coverage   50.42%   50.44%   +0.03%     
==========================================
  Files         374      374              
  Lines       31335    31328       -7     
==========================================
+ Hits        15797    15801       +4     
+ Misses      15538    15527      -11     
Impacted Files Coverage Δ
.../collision_detection/test_collision_common_panda.h 98.73% <ø> (ø)
...it/collision_detection/test_collision_common_pr2.h 100.00% <ø> (ø)
moveit_core/robot_state/src/robot_state.cpp 47.91% <0.00%> (-0.03%) ⬇️
...ustrial_motion_planner_testutils/testdata_loader.h 100.00% <ø> (ø)
...s/include/moveit_setup_controllers/controllers.hpp 8.00% <0.00%> (-0.33%) ⬇️
...ramework/include/moveit_setup_framework/config.hpp 32.00% <50.00%> (-1.33%) ⬇️
...pilz_industrial_motion_planner_testutils/basecmd.h 90.48% <75.00%> (-4.26%) ⬇️
...lude/moveit/collision_detection/collision_matrix.h 100.00% <100.00%> (ø)
...veit/trajectory_processing/time_parameterization.h 100.00% <100.00%> (ø)
...strial_motion_planner/src/trajectory_generator.cpp 96.74% <100.00%> (ø)
... and 25 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rhaschke rhaschke force-pushed the fix-clang-tidy branch 8 times, most recently from 69c8c34 to f8ad26d Compare January 8, 2023 10:58
@rhaschke rhaschke force-pushed the fix-clang-tidy branch 8 times, most recently from a2c93e1 to b13e4c0 Compare January 8, 2023 19:47
@rhaschke
Copy link
Contributor Author

rhaschke commented Jan 8, 2023

After a full day of work, all compiler warnings in the moveit2 repo are fixed again. I don't know why we have such an elaborated CI framework if error-checking gets disabled (or downgraded to warnings) as soon as they provide hurdles.
We should really trust the compilers and fix those warnings.

Copy link
Member

@tylerjw tylerjw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this change. I don't remember warnings being disabled in CI; I didn't know they were. I'm sorry I didn't see that before.

I was the one who disabled the python test that you re-enabled yesterday. Thank you for that; I didn't how to deal with that one. It looks like it was as simple as removing that import as it was unused.

@tylerjw
Copy link
Member

tylerjw commented Jan 8, 2023

Would you like to merge this now or wait on that pull request to update google test? I think merging now would be nice, but I'm unsure what effect that has on people who build locally.

Copy link
Contributor

@ChrisThrasher ChrisThrasher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like a lot about this. My only feedback is about the addition of destructors and how that implicitly deletes move semantics. This won't break user code per se but it can have performance impacts by converting some moves into copies. Do we care enough to = default the move operators as well?

As a user-declared destructor deletes any implicitly-defined move constructor/assignment operator,
we need to declared them manually. This in turn requires to declare the copy constructor/assignment as well.
@rhaschke
Copy link
Contributor Author

rhaschke commented Jan 9, 2023

Would you like to merge this now or wait on that pull request to update google test?

I suggest merging now to reenable stricter CI. The newer google test doesn't pose a problem locally. Your build log is just more cluttered with warnings (and you can't use -Werror). But that's the current status quo anyway.

@rhaschke rhaschke force-pushed the fix-clang-tidy branch 2 times, most recently from aba4e4f to 6125c57 Compare January 9, 2023 10:03
... as they are not implicitly declared anymore
Copy link
Member

@henningkayser henningkayser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why haven't we merged this yet? The only hold-back I see is that we might want to add a note to some documentation to locally switch to gtest1.11, but otherwise I agree with @rhaschke that we should not have to wait for the ament fix. Also, we should backport this to humble, right?

@rhaschke rhaschke merged commit 936b4ad into moveit:main Jan 26, 2023
@rhaschke rhaschke deleted the fix-clang-tidy branch January 26, 2023 12:49
rhaschke added a commit to rhaschke/moveit2 that referenced this pull request Jan 26, 2023
- Fix warning: definition of implicit copy assignment operator is deprecated
- Fix warning: expression with side effects will be evaluated
- Fix warning: passing by value
- Enable -Werror
- Fix -Wdelete-non-abstract-non-virtual-dtor
- Fix more clang warnings
- Modernize gtest: TYPED_TEST_CASE -> TYPED_TEST_SUITE
- Fix GoogleTestVerification.UninstantiatedTypeParameterizedTestSuite
- Add default copy/move constructors/assignment operators
  As a user-declared destructor deletes any implicitly-defined move constructor/assignment operator,
  we need to declared them manually. This in turn requires to declare the copy constructor/assignment as well.
- Explicitly declare overrides
- Add default constructors as they are not implicitly declared anymore
- Declare selected classes as final
- Add noexcept specifier to constructors
rhaschke added a commit to rhaschke/moveit2 that referenced this pull request Feb 12, 2023
- Fix warning: definition of implicit copy assignment operator is deprecated
- Fix warning: expression with side effects will be evaluated
- Fix warning: passing by value
- Enable -Werror
- Fix -Wdelete-non-abstract-non-virtual-dtor
- Fix more clang warnings
- Modernize gtest: TYPED_TEST_CASE -> TYPED_TEST_SUITE
- Fix GoogleTestVerification.UninstantiatedTypeParameterizedTestSuite
- Add default copy/move constructors/assignment operators
  As a user-declared destructor deletes any implicitly-defined move constructor/assignment operator,
  we need to declared them manually. This in turn requires to declare the copy constructor/assignment as well.
- Explicitly declare overrides
- Add default constructors as they are not implicitly declared anymore
- Declare selected classes as final
- Add noexcept specifier to constructors
rhaschke added a commit that referenced this pull request Feb 12, 2023
- Fix warning: definition of implicit copy assignment operator is deprecated
- Fix warning: expression with side effects will be evaluated
- Fix warning: passing by value
- Enable -Werror
- Fix -Wdelete-non-abstract-non-virtual-dtor
- Fix more clang warnings
- Modernize gtest: TYPED_TEST_CASE -> TYPED_TEST_SUITE
- Fix GoogleTestVerification.UninstantiatedTypeParameterizedTestSuite
- Add default copy/move constructors/assignment operators
  As a user-declared destructor deletes any implicitly-defined move constructor/assignment operator,
  we need to declared them manually. This in turn requires to declare the copy constructor/assignment as well.
- Explicitly declare overrides
- Add default constructors as they are not implicitly declared anymore
- Declare selected classes as final
- Add noexcept specifier to constructors
- Fixup gmock/gtest warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants