Skip to content

Commit

Permalink
COMP: Fix uninialized variable warning
Browse files Browse the repository at this point in the history
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;
      |             ^~~~~~~~~~~
  • Loading branch information
hjmjohnson committed Apr 30, 2024
1 parent fdb94ed commit d9fcaa0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class SymmetricEigenAnalysisFunction
inline TOutput
operator()(const TInput & x) const
{
TOutput eigenValues;
TOutput eigenValues{};

m_Calculator.ComputeEigenValues(x, eigenValues);
return eigenValues;
Expand Down

0 comments on commit d9fcaa0

Please sign in to comment.