Skip to content

Conversation

@gnawme
Copy link
Contributor

@gnawme gnawme commented Dec 23, 2025

Migrate #6368, Part B including apps changes to manage the size of the PR.

Add 4 additional bugprone clang-tidy checks and applied fixes

  1. bugprone-assert-side-effect
  2. bugprone-dangling-handle
  3. bugprone-forward-declaration-namespace
  4. bugprone-inaccurate-erase

Summary

These checks improve code safety and correctness by:

  • Preventing subtle bugs from dangling references
  • Ensuring consistent namespace declarations
  • Fixing incorrect container erase patterns
  • Eliminating side effects in assertions

@gnawme gnawme force-pushed the norm.evangelista/add-further-bugprone-checks-part-b branch from 6e0167f to c26c4c6 Compare December 31, 2025 18:01
centroid[1] + (0.5f * model[1]),
centroid[2] + (0.5f * model[2]));
sprintf(name, "normal_%d", unsigned(i));
sprintf(name, "normal_%d", static_cast<unsigned>(i));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
sprintf(name, "normal_%d", static_cast<unsigned>(i));
sprintf(name, "normal_%d", static_cast<unsigned int>(i));

char name[1024];
for (std::size_t i = 0; i < prev_models_size; i++) {
sprintf(name, "normal_%d", unsigned(i));
sprintf(name, "normal_%d", static_cast<unsigned>(i));
Copy link
Contributor

Choose a reason for hiding this comment

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

`

Suggested change
sprintf(name, "normal_%d", static_cast<unsigned>(i));
sprintf(name, "normal_%d", static_cast<unsigned int>(i));

typename EdgeAwarePlaneComparator<PointT, Normal>::Ptr plane_comparator_;
PointIndices::Ptr plane_indices_;
unsigned char* rgb_data_;
unsigned char* rgb_data_{};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
unsigned char* rgb_data_{};
unsigned char* rgb_data_{nullptr};

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.

2 participants