From 74b4ddb21579f6adb7d5d40ba33180e2c12d3be3 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 1 Apr 2024 14:22:49 -0400 Subject: [PATCH] COMP: Uninitialized in GetNumberOfComponentsPerPixel Addresses: ``` In file included from /Users/matt.mccormick/src/ITK/Modules/External/ITKRLEImage/test/itkRLEImageTest.cxx:19: /Users/matt.mccormick/src/ITK/Modules/External/ITKRLEImage/include/itkRLEImage.h:214:53: warning: variable 'p' is uninitialized when passed as a const reference argument here [-Wuninitialized-const-reference] return itk::NumericTraits::GetLength(p); ``` on macOS clang. --- include/itkRLEImage.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/itkRLEImage.h b/include/itkRLEImage.h index bb4a3c8..6a9563f 100644 --- a/include/itkRLEImage.h +++ b/include/itkRLEImage.h @@ -209,9 +209,7 @@ class RLEImage : public itk::ImageBase { // use the GetLength() method which works with variable length arrays, // to make it work with as much pixel types as possible - PixelType p; - - return itk::NumericTraits::GetLength(p); + return itk::NumericTraits::GetLength({}); } /** Typedef for the internally used buffer. */