-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add more bugprone-* clang-tidy checks, Part B #6380
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
base: master
Are you sure you want to change the base?
Add more bugprone-* clang-tidy checks, Part B #6380
Conversation
6e0167f to
c26c4c6
Compare
mvieth
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.
I did not have a look at all the files yet, but here are already some comments.
In the cases where you introduced a dynamic_cast, I think it would be a good idea to check if the result is a nullptr before dereferencing it.
| (*label_image)[euclidean_label_index.indices[j]].r = 255; | ||
| (*label_image)[euclidean_label_index.indices[j]].g = 0; | ||
| (*label_image)[euclidean_label_index.indices[j]].b = 0; | ||
| for (int index : euclidean_label_index.indices) { |
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.
| for (int index : euclidean_label_index.indices) { | |
| for (const auto& index : euclidean_label_index.indices) { |
| for (const auto& region_index : region_indices) { | ||
| if (region_index.indices.size() > 1000) { | ||
| for (std::size_t j = 0; j < region_index.indices.size(); j++) { | ||
| for (int index : region_index.indices) { |
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.
| for (int index : region_index.indices) { | |
| for (const auto& index : region_index.indices) { |
| pcl::PointXYZ ground_pt((*cloud)[region_index.indices[j]].x, | ||
| (*cloud)[region_index.indices[j]].y, | ||
| (*cloud)[region_index.indices[j]].z); | ||
| for (int index : region_index.indices) { |
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.
| for (int index : region_index.indices) { | |
| for (const auto& index : region_index.indices) { |
Migrate #6368, Part B including
appschanges to manage the size of the PR.Add 4 additional bugprone clang-tidy checks and applied fixes
bugprone-assert-side-effectbugprone-dangling-handlebugprone-forward-declaration-namespacebugprone-inaccurate-eraseSummary
These checks improve code safety and correctness by: