-
-
Notifications
You must be signed in to change notification settings - Fork 686
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
COMP: fixed various Wunused-but-set-variable warnings from Clang 13 #2778
COMP: fixed various Wunused-but-set-variable warnings from Clang 13 #2778
Conversation
@thewtex @dzenanz @hjmjohnson I'm not at all sure these are the best fixes here. But figured I'd do something and we can discuss here. Only someone that knows these classes can really know if the code is dead from an old refactoring, or if those variables should in fact be used. |
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 made some suggestions where I felt different from your proposal.
8d84585
to
58a7f48
Compare
|
58a7f48
to
a79936d
Compare
Errors:
|
Two solutions: - removed the dead code. - use the variable by logging it
a79936d
to
8a86299
Compare
So is this patch good to go? The 2 failed checks are both |
Alright! That should fix the last of the non-HDF warnings from my bots! |
} | ||
++testIter; | ||
} | ||
std::cout << "Dummy sum: " << sum << std::endl; |
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.
@seanm
Were are not getting some valgrind defect related to this change:
https://open.cdash.org/viewDynamicAnalysisFile.php?id=8854676
It looks like the image buffer is never initialized?
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'll take a look, and try with ASan too...
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.
Alas, ASan reports nothing, which is expected if it's really uninitialized memory use. But looking over the code, I don't spot the issue...
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've run the test many times and always get the same number, -3.36317e+12. Is that what you get? I'd expect different results if it's using uninitialized memory.
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 didn't run the test. I just saw that the buffer was uninitialized.
I have had uninitialized values be reproducible on a system before. Do you get the same for debug and release? different OS? Can you tell me where the pixel values come from?
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 was getting 0 for the value. I made what I expect to be the fix in PR #2841
Three solutions:
PR Checklist
Refer to the ITK Software Guide for
further development details if necessary.