-
-
Notifications
You must be signed in to change notification settings - Fork 686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
COMP: Ubuntu2404 fixes issue 4607 #4608
COMP: Ubuntu2404 fixes issue 4607 #4608
Conversation
b5135cc
to
75a6ebd
Compare
Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorSplitEdgeTest.cxx
Outdated
Show resolved
Hide resolved
Modules/Core/Common/test/itkShapedImageNeighborhoodRangeGTest.cxx
Outdated
Show resolved
Hide resolved
6130b79
to
720e089
Compare
720e089
to
931ded8
Compare
da2f03e
to
d027b63
Compare
d027b63
to
66d71ee
Compare
/azp run ITK.Linux |
529d2f2
to
5e29345
Compare
This allows for clean building on the latest Ubuntu 24.04 release with GCC 13.2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for addressing these warnings. A suggestion to consider, that would reduce code size.
The gcc 13.2 compiler warns about potential index out of bounds errors in cases where the index is not explicitly requested is not explicitly tested. Avoid using index operator when index would be out of known compile time bounds. In member function 'constexpr const itk::Size<VDimension>::value_type& itk::Size<VDimension>::operator[](size_type) const [with unsigned int VDimension = 2]', ITK/Modules/Core/Common/include/itkSize.h:356:85: warning: array subscript 2 is above array bounds of 'const itk::Size<2>::SizeValueType [2]' {aka 'const long unsigned int [2]'} [-Warray-bounds=] 356 | constexpr const_reference operator[](size_type pos) const { return m_InternalArray[pos]; }
The down-casted object is never used. Only the existence of the pointer is needed, and the type of the pointer is not relavant.
Providing tests for the known container size requirements makes the test more transparent.
The number really does not matter, but make a variable to indicate where it needs to be consistent in the test.
…essing Change testing pixel type to unsigned short to avoid compiler string processing security checking that issued a false positive warning. In function '_OIter std::reverse_copy(_BIter, _BIter, _OIter) [with _BIter = __gnu_cxx::__normal_iterator<const unsigned char*, vector<unsigned char> >; _OIter = __gnu_cxx::__normal_iterator<unsigned char*, vector<unsigned char> >]', inlined from 'virtual void ShapedImageNeighborhoodRange_IteratorsCanBePassedToStdReverseCopy_Test::TestBody()' at ITK/Modules/Core/Common/test/itkShapedImageNeighborhoodRangeGTest.cxx:379:20: /usr/include/c++/13/bits/stl_algo.h:1172:21: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 1172 | *__result = *__last; | ~~~~~~~~~~^~~~~~~~~
Remove suppression of warnings about using c++14 features that are not mandatory to be implemented in minimum supported c++17. We now require c++17, so do not warn if c++14 features are used.
In member function 'unsigned int itk::SymmetricEigenAnalysis<TMatrix, TVector, TEigenMatrix>::ComputeEigenValuesLegacy(const TMatrix&, TVector&) const [with TMatrix = itk::SymmetricSecondRankTensor<float, 3>; TVector = itk::FixedArray<double, 3>; TEigenMatrix = itk::SymmetricSecondRankTensor<float, 3>]', inlined from 'unsigned int itk::SymmetricEigenAnalysis<TMatrix, TVector, TEigenMatrix>::ComputeEigenValues(const TMatrix&, TVector&) const [with TMatrix = itk::SymmetricSecondRankTensor<float, 3>; TVector = itk::FixedArray<double, 3>; TEigenMatrix = itk::SymmetricSecondRankTensor<float, 3>]' at ITK/Modules/Core/Common/include/itkSymmetricEigenAnalysis.hxx:36:36, inlined from 'TOutput itk::Functor::SymmetricEigenAnalysisFunction<TInput, TOutput>::operator()(const TInput&) const [with TInput = itk::SymmetricSecondRankTensor<float, 3>; TOutput = itk::FixedArray<double, 3>]' at ITK/Modules/Filtering/ImageIntensity/include/itkSymmetricEigenAnalysisImageFilter.h:61:36, inlined from 'void itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction>::DynamicThreadedGenerateData(const OutputImageRegionType&) [with TInputImage = itk::Image<itk::SymmetricSecondRankTensor<float, 3>, 3>; TOutputImage = itk::Image<itk::FixedArray<double, 3>, 3>; TFunction = itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<float, 3>, itk::FixedArray<double, 3> >]' at ITK/Modules/Core/Common/include/itkUnaryFunctorImageFilter.hxx:97:29: ITK/Modules/Core/Common/include/itkSymmetricEigenAnalysis.hxx:70:18: warning: 'eigenValues' may be used uninitialized [-Wmaybe-uninitialized] 70 | dVector[row] = D[row]; In file included from ITK/Modules/Filtering/ImageIntensity/test/itkSymmetricEigenAnalysisImageFilterTest.cxx:22: ITK/Modules/Filtering/ImageIntensity/include/itkSymmetricEigenAnalysisImageFilter.h: In member function 'void itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction>::DynamicThreadedGenerateData(const OutputImageRegionType&) [with TInputImage = itk::Image<itk::SymmetricSecondRankTensor<float, 3>, 3>; TOutputImage = itk::Image<itk::FixedArray<double, 3>, 3>; TFunction = itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<float, 3>, itk::FixedArray<double, 3> >]': ITK/Modules/Filtering/ImageIntensity/include/itkSymmetricEigenAnalysisImageFilter.h:59:13: note: 'eigenValues' declared here 59 | TOutput eigenValues; | ^~~~~~~~~~~
In member function 'itk::QuadEdge::Self* itk::QuadEdge::GetSym()', inlined from 'itk::GeometricalQuadEdge<TVRef, TFRef, TPrimalData, TDualData, PrimalDual>::Self* itk::GeometricalQuadEdge<TVRef, TFRef, TPrimalData, TDualData, PrimalDual>::GetSym() [with TVRef = long unsigned int; TFRef = long unsigned int; TPrimalData = bool; TDualData = bool; bool PrimalDual = true]' at ITK/Modules/Core/QuadEdgeMesh/include/itkGeometricalQuadEdge.h:106:3, inlined from 'typename itk::QuadEdgeMeshEulerOperatorSplitEdgeFunction<TMesh, TQEType>::Superclass::OutputType itk::QuadEdgeMeshEulerOperatorSplitEdgeFunction<TMesh, TQEType>::Evaluate(QEType*) [with TMesh = itk::QuadEdgeMesh<double, 3>; TQEType = itk::GeometricalQuadEdge<long unsigned int, long unsigned int, bool, bool, true>]' at ITK/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorSplitEdgeFunction.h:76:36, inlined from 'int itkQuadEdgeMeshEulerOperatorSplitEdgeTest(int, char**)' at ITK/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorSplitEdgeTest.cxx:45:26: ITK/Modules/Core/QuadEdgeMesh/include/itkQuadEdge.h:245:15: warning: array subscript 0 is outside array bounds of 'QEType [0]' [-Warray-bounds=] 245 | if (this->m_Rot) | ~~~~~~^~~~~
5e29345
to
462a874
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for addressing these @hjmjohnson !
@thewtex I assume we want 5.4.0 to build cleanly on Ubuntu 24.04. This is a lot of small changes, but I think they are appropriate for 5.4.0. I'll let you merge, or change the milestone. If you change the milestone, please convert to a draft. |
Fixes for 100's of warnings presented by the gcc 13.2 compiler under the upcoming Ubuntu 24.04 LTS release.
This does not fix all of the issues, but is for comparison against the master branch build
https://open.cdash.org/builds/9565813
Additional information
Related to issue #4607
These new compiler warnings are due to increased default security settings in Ubuntu 24.04.
https://ubuntu.com/blog/whats-new-in-security-for-ubuntu-24-04-lts#:~:text=Overall%2C%20the%20vast%20range%20of,most%20secure%20release%20to%20date.
PR Checklist
Refer to the ITK Software Guide for
further development details if necessary.