BUG: Initialize member in itk::AttributeLabelObject#2660
Conversation
|
Uncovered by #2652. |
|
Could you also please adjust the default-constructor, with this commit? It now says: Your commit answers this question! If possible, please "default" the default-constructor: ITK/Modules/Filtering/LabelMap/include/itkAttributeLabelObject.h Lines 144 to 147 in 40f9860 |
40f9860 to
8afd3d5
Compare
Good catch. Done in 8afd3d5. @N-Dekker thanks for the review. Could you please update the necessary sections in the ITK SW Guide to be up-to-date concerning these practices? At least the Development Guideline and Coding Style Guide parts. |
Initialize member in `itk::AttributeLabelObject`. Fixes: ``` ==6189== Command: /tmp/bld/ITK-build/bin/ITKLabelMapTestDriver itkAttributeLabelObjectAccessorsTest1 /tmp/bld/ITK-build/ExternalData/Testing/Data/Input/cthead1Label.png /tmp/bld/ITK-build/ExternalData/Testing/Data/Input/cthead1.png ==6189== Parent PID: 55 ==6189== UMC ==6189== Conditional jump or move depends on uninitialised value(s) ==6189== at 0x91423DC: __printf_fp_l (in /usr/lib64/libc-2.17.so) ==6189== by 0x91414D6: vfprintf (in /usr/lib64/libc-2.17.so) ==6189== by 0x916C178: vsnprintf (in /usr/lib64/libc-2.17.so) ==6189== by 0x8C5B63C: ??? (in /usr/lib64/libstdc++.so.6.0.19) ==6189== by 0x8C61CA3: std::ostreambuf_iterator > std::num_put > >::_M_insert_float(std::ostreambuf_iterator >, std::ios_base&, char, char, >double) const (in /usr/lib64/libstdc++.so.6.0.19) ==6189== by 0x8C61F8F: std::num_put > >::do_put(std::ostreambuf_iterator >, std::ios_base&, char, double) const >(in /usr/lib64/libstdc++.so.6.0.19) ==6189== by 0x8C6DB94: std::ostream& std::ostream::_M_insert(double) (in /usr/lib64/libstdc++.so.6.0.19) ==6189== by 0x2F0A06: itk::AttributeLabelObject::PrintSelf(std::ostream&, itk::Indent) const (itkAttributeLabelObject.h:155) ==6189== by 0x67D4A99: itk::LightObject::Print(std::ostream&, itk::Indent) const (itkLightObject.cxx:125) ==6189== by 0x2E74F9: itkAttributeLabelObjectAccessorsTest1(int, char**) (itkAttributeLabelObjectAccessorsTest1.cxx:80) ==6189== by 0x278CF5: main (ITKLabelMapTestDriver.cxx:467) ``` Raised in: https://open.cdash.org/viewDynamicAnalysisFile.php?id=8560922 Provide a default initialization to the default constructor.
8afd3d5 to
68ecf0d
Compare
N-Dekker
left a comment
There was a problem hiding this comment.
Thanks very much @jhlegarreta I'll have another look at the ITK SW Guide when I have some more time.
Initialize member in
itk::AttributeLabelObject.Fixes:
Raised in:
https://open.cdash.org/viewDynamicAnalysisFile.php?id=8560922
Provide a default initialization to the default constructor.
PR Checklist