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

Build in Debug mode fails after "fix-32bits-dicom-read-crash" #4546

Closed issakomi closed 3 months ago

issakomi commented 3 months ago

Build in Debug mode fails after fix-32bits-dicom-read-crash .

Debian Linux 12, gcc version 12.2.0 (Debian 12.2.0-14).

/home/r/itk/ITK/Modules/IO/GDCM/src/itkGDCMImageIO.cxx: In function ‘bool itk::readNoPreambleDicom(std::ifstream&)’:
/home/r/itk/ITK/Modules/Core/Common/include/itkMacro.h:504:11: error: invalid use of ‘this’ in non-member function
  504 |       if (this->GetDebug() && ::itk::Object::GetGlobalWarningDisplay())        \
      |           ^~~~
/home/r/itk/ITK/Modules/IO/GDCM/src/itkGDCMImageIO.cxx:191:3: note: in expansion of macro ‘itkDebugMacro’
  191 |   itkDebugMacro(<< "No DICOM magic number found, but the file appears to be DICOM without a preamble.");
      |   ^~~~~~~~~~~~~
/home/r/itk/ITK/Modules/Core/Common/include/itkMacro.h:508:19: error: invalid use of ‘this’ in non-member function
  508 |                << this->GetNameOfClass() << " (" << this << "): " x << "\n\n"; \
      |                   ^~~~
/home/r/itk/ITK/Modules/IO/GDCM/src/itkGDCMImageIO.cxx:191:3: note: in expansion of macro ‘itkDebugMacro’
  191 |   itkDebugMacro(<< "No DICOM magic number found, but the file appears to be DICOM without a preamble.");
      |   ^~~~~~~~~~~~~
/home/r/itk/ITK/Modules/Core/Common/include/itkMacro.h:508:53: error: invalid use of ‘this’ in non-member function
  508 |                << this->GetNameOfClass() << " (" << this << "): " x << "\n\n"; \
      |                                                     ^~~~
/home/r/itk/ITK/Modules/IO/GDCM/src/itkGDCMImageIO.cxx:191:3: note: in expansion of macro ‘itkDebugMacro’
  191 |   itkDebugMacro(<< "No DICOM magic number found, but the file appears to be DICOM without a preamble.");
      |   ^~~~~~~~~~~~~
make[2]: *** [Modules/IO/GDCM/src/CMakeFiles/ITKIOGDCM.dir/build.make:76: Modules/IO/GDCM/src/CMakeFiles/ITKIOGDCM.dir/itkGDCMImageIO.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:9402: Modules/IO/GDCM/src/CMakeFiles/ITKIOGDCM.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

A similar error will occur with DCMTK IO if it is enabled.

issakomi commented 3 months ago

4544 will fix the issue