-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fix uninitialized build warning #6321
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?
Fix uninitialized build warning #6321
Conversation
MaximSmolskiy
commented
Aug 17, 2025
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 your pull request. I am pretty sure that the warning is a false positive: strongest_peak
is only read from if peak_counter
is not zero (line 191), which can only happen if strongest_peak
was set to something valid (lines 185 and 187). I am assuming you are testing with PCL 1.14.0 or newer, see 053995b
I was also not able to reproduce the warning with GCC 11.5.0, so perhaps the maybe-uninitialized detection logic has been improved between the two compiler versions?
If you would still like to initialize strongest_peak
with -1
, please add an additional check in line 191, testing that strongest_peak
is now different from -1
(to have a consistent logic)
Yes, I also think that warning is false positive. And I think it's better to get rid of such warnings if it's not too difficult
Yes, I tested
There are four related variables - |
I would at least like a check for |
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, looks good now.