[Insight-developers] GCC 4.8.2 compiler warning

Bradley Lowekamp blowekamp at mail.nih.gov
Wed Nov 27 07:31:45 EST 2013


Hans,

I have looked into this issue a couple times. It shows up on the Debian sid (unstable) nightly build:
http://open.cdash.org/viewBuildError.php?type=1&buildid=3116766

The code in the ImageAlgorithm looks correct and no other system has issues. Even VS debug which adds buffer over run check is OK.

Given that the error does not include line number, I figured it's deep in the optimization phases of the compiler. I think the issue is with the compiler.

That being said, you might be able to move a couple lines and statements around to get rid of the warning. But I have not seen any issue with the logic.

Brad

On Nov 26, 2013, at 8:41 PM, "Johnson, Hans J" <hans-johnson at uiowa.edu> wrote:

> 
> I¹m getting the following warning on gcc 4.8.2:
> 
> In file included from
> /tmp/src/ITK/Modules/Core/Common/include/itkContinuousIndex.h:22:0,
>                 from
> /tmp/src/ITK/Modules/Core/Common/include/itkImageRegion.h:34,
>                 from
> /tmp/src/ITK/Modules/Core/Common/include/itkImage.h:21,
>                 from
> /tmp/src/ITK/Modules/Core/Common/include/itkImageSource.h:32,
>                 from
> /tmp/src/ITK/Modules/Core/Mesh/include/itkTriangleMeshToBinaryImageFilter.h
> :21,
>                 from
> /tmp/src/ITK/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest3
> .cxx:19:
> /tmp/src/ITK/Modules/Core/Common/include/itkIndex.h: In static member
> function Œstatic void itk::ImageAlgorithm::DispatchedCopy(const
> InputImageType*, OutputImageType*, const typename
> InputImageType::RegionType&, const typename OutputImageType::RegionType&,
> itk::ImageAlgorithm::TrueType) [with InputImageType = itk::Image<unsigned
> char, 3u>; OutputImageType = itk::Image<unsigned char, 3u>; typename
> InputImageType::RegionType = itk::ImageRegion<3u>; typename
> OutputImageType::RegionType = itk::ImageRegion<3u>;
> itk::ImageAlgorithm::TrueType = std::tr1::integral_constant<bool, true>]¹:
> /tmp/src/ITK/Modules/Core/Common/include/itkIndex.h:226:19: warning: array
> subscript is above array bounds [-Warray-bounds]
>   { return m_Index[dim]; }
>                   ^
> /tmp/src/ITK/Modules/Core/Common/include/itkIndex.h:226:19: warning: array
> subscript is above array bounds [-Warray-bounds]
> /tmp/src/ITK/Modules/Core/Common/include/itkIndex.h:226:19: warning: array
> subscript is above array bounds [-Warray-bounds]
>   { return m_Index[dim]; }
>                   ^
> 
> It looks serious to me, but I don¹t know how to decipher it.
> 
> 
> I¹m not going to be able to look at this anytime soon.
> 
> Hans
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
> ________________________________



More information about the Insight-developers mailing list