Page MenuHomePhabricator

compile errors with g++ 4.1.2
Closed, ResolvedPublic

Description

Three easy-to-fix compile errors with gcc 4.1.2 on Slackware, 32 bit.

In file included from /build/niftk-release/CMakeExternals/Source/MITK/Core/Code/Algorithms/mitkExtractSliceFilter.cpp:23:
/build/niftk-release/CMakeExternals/Source/MITK/Core/Code/Algorithms/mitkPlaneClipping.h:141:7: error: no newline at end of file


[ 23%] Building CXX object Core/Code/CMakeFiles/Mitk.dir/Rendering/vtkMitkLevelWindowFilter.cpp.o
cc1plus: warnings being treated as errors
/build/niftk-release/CMakeExternals/Source/MITK/Core/Code/Rendering/vtkMitkLevelWindowFilter.cpp: In function 'void vtkApplyLookupTableOnRGBA(vtkMitkLevelWindowFilter*, vtkImageData*, vtkImageData*, int*, vtkFloatingPointType*, T*) [with T = vtkMitkLevelWindowFilter::ThreadedExecute::VTK_TT]':
/build/niftk-release/CMakeExternals/Source/MITK/Core/Code/Rendering/vtkMitkLevelWindowFilter.cpp:489: instantiated from here
/build/niftk-release/CMakeExternals/Source/MITK/Core/Code/Rendering/vtkMitkLevelWindowFilter.cpp:208: warning: converting to 'unsigned char' from 'double'
/build/niftk-release/CMakeExternals/Source/MITK/Core/Code/Rendering/vtkMitkLevelWindowFilter.cpp: In function 'void vtkApplyLookupTableOnRGBA(vtkMitkLevelWindowFilter*, vtkImageData*, vtkImageData*, int*, vtkFloatingPointType*, T*) [with T = vtkMitkLevelWindowFilter::ThreadedExecute::VTK_TT]':
/build/niftk-release/CMakeExternals/Source/MITK/Core/Code/Rendering/vtkMitkLevelWindowFilter.cpp:489: instantiated from here
/build/niftk-release/CMakeExternals/Source/MITK/Core/Code/Rendering/vtkMitkLevelWindowFilter.cpp:208: warning: converting to 'unsigned char' from 'vtkMitkLevelWindowFilter::ThreadedExecute::VTK_TT'

In vtkMitkLevelWindowFilter:208 there is a static_cast to T, but the leftvalue is declared as unsigned char. I think, either the declaration type of the variable should be changed to T, or the static cast to unsigned char, I don't know which is correct.


[ 23%] Building CXX object Core/Code/CMakeFiles/Mitk.dir/Rendering/mitkRenderingTestHelper.cpp.o
cc1plus: warnings being treated as errors
/build/niftk-release/CMakeExternals/Source/MITK/Core/Code/Rendering/mitkRenderingTestHelper.cpp: In member function 'void mitkRenderingTestHelper::SaveAsPNG(std::string)':
/build/niftk-release/CMakeExternals/Source/MITK/Core/Code/Rendering/mitkRenderingTestHelper.cpp:164: warning: passing 'double' for argument 1 to 'virtual void vtkRenderLargeImage::SetMagnification(int)'

1.0 should be changed to 1 in the call.

Event Timeline

Thanks for your bug report. I merged your changes to the MITK master (see T8165).

I didn't verify if gcc 4.1.2 now compiles everything. If you find more errors, you could list them here. Otherwise please close the bug - thanks.

I fixed these manually in my build and these were the only problems, so I close this.
Thanks for the fixes!