Skip to content

Commit

Permalink
COMP: Uninitialized in GetNumberOfComponentsPerPixel
Browse files Browse the repository at this point in the history
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<PixelType>::GetLength(p);
```

on macOS clang.
  • Loading branch information
thewtex authored and dzenanz committed Apr 1, 2024
1 parent a3bdf29 commit 5ce8cd1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions include/itkRLEImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,7 @@ class RLEImage : public itk::ImageBase<VImageDimension>
{
// 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<PixelType>::GetLength(p);
return itk::NumericTraits<PixelType>::GetLength({});
}

/** Typedef for the internally used buffer. */
Expand Down

0 comments on commit 5ce8cd1

Please sign in to comment.