<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">There are two loops which look like this:<div><br></div><div><a href="https://github.com/Kitware/ITK/blob/master/Modules/Core/Common/include/itkImageAlgorithm.hxx#L148">https://github.com/Kitware/ITK/blob/master/Modules/Core/Common/include/itkImageAlgorithm.hxx#L148</a></div><div><br></div><div><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 204); "> </span><span class="k" style="font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">for</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 204); "> </span><span class="p" style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">(</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 204); "> </span><span class="kt" style="color: rgb(68, 85, 136); font-weight: bold; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">unsigned</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 204); "> </span><span class="kt" style="color: rgb(68, 85, 136); font-weight: bold; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">int</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 204); "> </span><span class="n" style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">i</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 204); "> </span><span class="o" style="font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">=</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 204); "> </span><span class="n" style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">movingDirection</span><span class="p" style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">;</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 204); "> </span><span class="n" style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">i</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 204); "> </span><span class="o" style="font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">+</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 204); "> </span><span class="mi" style="color: rgb(0, 153, 153); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">1</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 204); "> </span><span class="o" style="font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; "><</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 204); "> </span><span class="n" style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">_RegionType</span><span class="o" style="font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">::</span><span class="n" style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">ImageDimension</span><span class="p" style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">;</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 204); "> </span><span class="o" style="font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">++</span><span class="n" style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">i</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 204); "> </span><span class="p" style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre; ">)</span></div><div><br></div><div><div><div>The use of the +1 there with the loop control variable is a little odd, but it was done to avoid a -1, and signed/unsigned interaction. I'd be curious of changing that made this warning go away, in exchanged for the signed/unsigned comparison warning.</div><div><br></div><div>Brad</div><div><br></div><div>On Nov 27, 2013, at 7:33 AM, "Johnson, Hans J" <<a href="mailto:hans-johnson@uiowa.edu">hans-johnson@uiowa.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Thanks Brad.<br><br><br>I too am beginning to think this compiler warnings are incorrect.<br><br>Hans<br><br><br>On 11/27/13, 6:31 AM, "Bradley Lowekamp" <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>> wrote:<br><br><blockquote type="cite">Hans,<br><br>I have looked into this issue a couple times. It shows up on the Debian<br>sid (unstable) nightly build:<br><a href="http://open.cdash.org/viewBuildError.php?type=1&buildid=3116766">http://open.cdash.org/viewBuildError.php?type=1&buildid=3116766</a><br><br>The code in the ImageAlgorithm looks correct and no other system has<br>issues. Even VS debug which adds buffer over run check is OK.<br><br>Given that the error does not include line number, I figured it's deep in<br>the optimization phases of the compiler. I think the issue is with the<br>compiler.<br><br>That being said, you might be able to move a couple lines and statements<br>around to get rid of the warning. But I have not seen any issue with the<br>logic.<br><br>Brad<br><br>On Nov 26, 2013, at 8:41 PM, "Johnson, Hans J" <hans-johnson@uiowa.edu><br>wrote:<br><br><blockquote type="cite"><br>Iım getting the following warning on gcc 4.8.2:<br><br>In file included from<br>/tmp/src/ITK/Modules/Core/Common/include/itkContinuousIndex.h:22:0,<br> from<br>/tmp/src/ITK/Modules/Core/Common/include/itkImageRegion.h:34,<br> from<br>/tmp/src/ITK/Modules/Core/Common/include/itkImage.h:21,<br> from<br>/tmp/src/ITK/Modules/Core/Common/include/itkImageSource.h:32,<br> from<br><br>/tmp/src/ITK/Modules/Core/Mesh/include/itkTriangleMeshToBinaryImageFilter<br>.h<br>:21,<br> from<br><br>/tmp/src/ITK/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTes<br>t3<br>.cxx:19:<br>/tmp/src/ITK/Modules/Core/Common/include/itkIndex.h: In static member<br>function static void itk::ImageAlgorithm::DispatchedCopy(const<br>InputImageType*, OutputImageType*, const typename<br>InputImageType::RegionType&, const typename<br>OutputImageType::RegionType&,<br>itk::ImageAlgorithm::TrueType) [with InputImageType =<br>itk::Image<unsigned<br>char, 3u>; OutputImageType = itk::Image<unsigned char, 3u>; typename<br>InputImageType::RegionType = itk::ImageRegion<3u>; typename<br>OutputImageType::RegionType = itk::ImageRegion<3u>;<br>itk::ImageAlgorithm::TrueType = std::tr1::integral_constant<bool,<br>true>]ı:<br>/tmp/src/ITK/Modules/Core/Common/include/itkIndex.h:226:19: warning:<br>array<br>subscript is above array bounds [-Warray-bounds]<br> { return m_Index[dim]; }<br> ^<br>/tmp/src/ITK/Modules/Core/Common/include/itkIndex.h:226:19: warning:<br>array<br>subscript is above array bounds [-Warray-bounds]<br>/tmp/src/ITK/Modules/Core/Common/include/itkIndex.h:226:19: warning:<br>array<br>subscript is above array bounds [-Warray-bounds]<br> { return m_Index[dim]; }<br> ^<br><br>It looks serious to me, but I donıt know how to decipher it.<br><br><br>Iım not going to be able to look at this anytime soon.<br><br>Hans<br><br><br><br><br><br><br><br><br><br>________________________________<br>Notice: This UI Health Care e-mail (including attachments) is covered<br>by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is<br>confidential and may be legally privileged. If you are not the intended<br>recipient, you are hereby notified that any retention, dissemination,<br>distribution, or copying of this communication is strictly prohibited.<br>Please reply to the sender that you have received the message in error,<br>then delete it. Thank you.<br>________________________________<br></blockquote><br></blockquote><br><br><br>________________________________<br>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.<br>________________________________<br></blockquote></div><br></div></body></html>