Page MenuHomePhabricator

MatchPointRegistration module compilation fails with Clang 11
Closed, ResolvedPublic

Description

In file included from /home/nolden/prj/dc/src/MITK/Modules/MatchPointRegistration/src/Helper/mitkImageStitchingHelper.cpp:13:
In file included from /home/nolden/prj/dc/src/MITK/Modules/MatchPointRegistration/include/mitkImageStitchingHelper.h:24:
In file included from /home/nolden/prj/dc/src/MITK/Modules/MatchPointRegistration/include/itkStitchImageFilter.h:327:
/home/nolden/prj/dc/src/MITK/Modules/MatchPointRegistration/include/itkStitchImageFilter.tpp:228:55: error: variable 'zeroComponent' is uninitialized when passed as a const reference argument here [-Werror,-Wuninitialized-const-reference]
      = NumericTraits<PixelComponentType>::ZeroValue( zeroComponent );
                                                      ^~~~~~~~~~~~~
/home/nolden/prj/dc/src/MITK/Modules/MatchPointRegistration/include/itkStitchImageFilter.h:259:3: note: in instantiation of member function 'itk::StitchImageFilter<itk::Image<int, 3>, itk::Image<int, 3>, double, double>::BeforeThreadedGenerateData' requested here
  StitchImageFilter();
  ^
/home/nolden/prj/dc/src/MITK/Modules/MatchPointRegistration/include/itkStitchImageFilter.h:81:15: note: in instantiation of member function 'itk::StitchImageFilter<itk::Image<int, 3>, itk::Image<int, 3>, double, double>::StitchImageFilter' requested here
  itkNewMacro(Self);

https://cdash.mitk.org/viewBuildError.php?buildid=8651

Revisions and Commits

Event Timeline

After reading the itk::NumericTraits documentation and looking into the actual definitions of ZeroValue() I guess the fix could be:

  PixelComponentType zeroComponent
-   = NumericTraits<PixelComponentType>::ZeroValue( zeroComponent );
+   = NumericTraits<PixelComponentType>::ZeroValue();
kislinsk triaged this task as Normal priority.Nov 25 2020, 11:47 PM
kislinsk added a subscriber: floca.

I can confirm this fixes the issue, I can merge it tomorrow

kislinsk added a revision: Restricted Differential Revision.Nov 28 2020, 5:00 AM
kislinsk claimed this task.

@nolden FYI: you can (auto-)link tasks and Differentials by either

  • mentioning the task in the summary of your Differential
    • When creating a revision with arcanist just add the line "Ref T28006"
    • The task will be even auto-closed after the landing of the Differential if you write "Fix T28006" or "Fixes T28006"
  • using the web UI, in the top right menu Edit Related Objects...Edit Revisions or Edit Related Objects...Edit Tasks