-
-
Notifications
You must be signed in to change notification settings - Fork 668
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
Compilation error while using itk::RelabelComponentImageFilte::GetSizeOfObjectInPhysicalUnits #4865
Comments
* Update parameter type to reflect underlying container indexing Fixes InsightSoftwareConsortium#4865
Now I understand why no one encountered this before. The pixel type of input to relabel filter is usually an output of connected components filter, which is unsigned (and usually large) integral type. And if that type is not large enough to hold the number of generated labels, I think there is an exception being raised. |
* Make arithmetic comparison safe with casting * Do not update parameter type to SizeValueType to avoid breaking public API Fixes InsightSoftwareConsortium#4865
* Make arithmetic comparison safe with casting * Do not update parameter type to SizeValueType to avoid breaking public API Fixes #4865
@kenavolic thanks for the bug report, the test code and the fix ! I wanted to test this locally on my MVSC 2022 compiler and found that using your gist test code the warning would not be raised. I digged a little bit into my compiler flags and saw that I had the Not only were these warnings reported, but dozens of other warnings were also reported. I did not go through them.
|
We don't have a lot of resources, so forcing all contributions to resolve ALL the possible warnings would be raising a bar way too high, at least in my opinion. We could enable more warnings for some of the dashboard builds, to raise awareness about them. |
That way at least we would be aware of the warnings, they would be openly visible, and could be addressed by anyone having the time and interest. |
I added |
Thanks for doing this Dženan. Not sure if I see any new warning in the dashboard: https://open.cdash.org/builds/9951189 Trying it locally would be good on one of your machines to see that there is additional warnings that are raised. I will try to post my |
I tried it locally, only to see no new warnings. |
Suppressing warnings about |
Moving this conversation to issue #4877. |
Description
Using the
itkRelabelComponentImageFilter
filterGetSizeOfObjectInPhysicalUnits
with signed integer image causes a compilation error due comparison of integer expressions of different signedness.Steps to Reproduce
Expected behavior
Should be able to use the class method
Actual behavior
Compilation error:
Reproducibility
Always (under the same compilation flags)
Versions
Current developpement version and older ones (detected on ITK5.2)
Environment
Additional Information
Link to discourse discussion
The text was updated successfully, but these errors were encountered: