[Insight-developers] LabelObject::ConstIndexIterator compiler warnings?

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Sat Jul 30 07:32:25 EDT 2011


Le 29 juil. 11 à 21:48, Williams, Norman K a écrit :

> I found this by adding -Wall -Wextra and doing an experimental build.
>
>
> /.../ITK/Modules/Filtering/LabelMap/include/ 
> itkLabelMapToLabelImageFilter.h
> xx:52: warning: 'it.itk::LabelObject<long unsigned int,
> 2u>::ConstIndexIterator::m_Index.itk::Index<2u>::m_Index[1u]' may be  
> used
> uninitialized in this function
>
> there are 220 warnings that you get with those flags and they all  
> seem to
> stem from the curiously semi-un-ITK-ish class
> LabelObject::ConstIndexIterator.
>
>
> Leaving off for now the fact that it's a nested cast with a name
> inconsistent with the rest of ITK...

Are we supposed to not use nested classes?
I took the implementation from Modules/Numerics/Statistics/include/ 
itkListSample.h and changed it to fit my needs.

Can you elaborate about what is wrong with the name?

This is a good time to enhance those new features!

>
> It looks as though this warning is a false positive -- any time the  
> index
> might actually be used, it is also set to a resonable value.
>
> But is it worth it to add code to initialize it? Or is there a free  
> or low
> computational cost way to restructure this class such that the warning
> goes away?


We can without problem initialize it in the constructor.

I'll propose a change.

Gaëtan

-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://mima2.jouy.inra.fr  http://www.itk.org
http://www.bepo.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110730/469ff183/attachment.pgp>


More information about the Insight-developers mailing list