[Insight-developers] itkAnchorHistogram: warning C4756: overflow in constant arithmetic :

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Sat Apr 11 14:28:22 EDT 2009


Hi Luis,

It is in my todo list. I'll try to fix it next week!

Thanks,

Gaëtan


Le 10 avr. 09 à 18:43, Luis Ibanez a écrit :

> Hi Gaetan,
>
> The class:   itkAnchorHistogram
>
> is producing a warning that looks like a real arithmetical problem.
>
> http://www.cdash.org/CDash/viewBuildError.php?type=1&buildid=309595
>
> It is  in Insight/Code/Review/itkAnchorHistogram.txx lines 134-135
>
>    m_Size = static_cast<unsigned int>(
>
>        NumericTraits< TInputPixel >::max() -
>        NumericTraits< TInputPixel >::NonpositiveMin() + 1 );
>
> Depending on the TInputPixel type, the range of max - min +1
> may exceed the capacity of that unsigned integer.
>
> In particular: Longs, Floats, and Doubles may result in integer
> overflows here.
>
>
> Could you suggest an alternative expression that may work
> for any pixel type ?
>
>
>   Thanks
>
>
>       Luis

-- 
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://voxel.jouy.inra.fr  http://www.mandriva.org
http://www.itk.org  http://www.clavier-dvorak.org

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


More information about the Insight-developers mailing list