InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.38k stars 661 forks source link

COMP: Remove use of itkDebugMacro in static method #4544

Closed thewtex closed 3 months ago

thewtex commented 3 months ago

To address:

/Users/builder/externalModules/IO/GDCM/src/itkGDCMImageIO.cxx:191:3: error: invalid use of 'this' outside of a non-static member function
  itkDebugMacro(<< "No DICOM magic number found, but the file appears to be DICOM without a preamble.");
  ^
[CTest: warning matched] /Users/builder/externalModules/Core/Common/include/itkMacro.h:504:11: note: expanded from macro 'itkDebugMacro'
      if (this->GetDebug() && ::itk::Object::GetGlobalWarningDisplay())        \
          ^
/Users/builder/externalModules/IO/GDCM/src/itkGDCMImageIO.cxx:191:3: error: invalid use of 'this' outside of a non-static member function
[CTest: warning matched] /Users/builder/externalModules/Core/Common/include/itkMacro.h:508:19: note: expanded from macro 'itkDebugMacro'
               << this->GetNameOfClass() << " (" << this << "): " x << "\n\n"; \
                  ^
/Users/builder/externalModules/IO/GDCM/src/itkGDCMImageIO.cxx:191:3: error: invalid use of 'this' outside of a non-static member function
[CTest: warning matched] /Users/builder/externalModules/Core/Common/include/itkMacro.h:508:53: note: expanded from macro 'itkDebugMacro'
               << this->GetNameOfClass() << " (" << this << "): " x << "\n\n"; \
                                                    ^
3 errors generated.

Re: https://open.cdash.org/viewBuildError.php?buildid=9495220

jhlegarreta commented 3 months ago

Sorry to chime in: this note in here looks relevant: https://github.com/InsightSoftwareConsortium/ITK/pull/4544/files#diff-216ad6bbbfe7f99a925b274660dcd203a7e873f64745ecf087dd4460c0a1ebc4R132 (should maybe say "method" instead of "file" but anyways)

But if it is relevant, it is worthwhile pointing that the DCMTK counterpart method is not static: it was recently changed in commit (including renaming it) https://github.com/InsightSoftwareConsortium/ITK/commit/decc3e5977e6e95a744c9d0ae08c53dfb10c7567#diff-4f73091b3003136c994a445b6eda56d8ac3e9044936fbb78a0649164a8c31a73R65

And thanks for all the effort to get all these fixes lately, and for noticing the dashboard failures this morning.

N-Dekker commented 3 months ago

/azp run ITK.macOS

thewtex commented 3 months ago

Thanks, all for the reviews. 👁️

Also removed from DCMTKImageIO.