vtkTIFFReader compile Error - calls protected method of vtkTiffReader from outside of class
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I am getting the following compiler error for VTK 5.6
[ 57%] /Users/Shared/OpenSource/VTK/IO/vtkTIFFReader.cxx:811:19: error: 'EvaluateImageAt' is a protected member of 'vtkTIFFReader' self->EvaluateImageAt(image+imagepos, static_cast<T>(buffer)+tilepos); ^ In file included from /Users/Shared/OpenSource/VTK/IO/vtkTIFFReader.cxx:15: /Users/Shared/OpenSource/VTK/IO/vtkTIFFReader.h:116:7: note: declared protected here int EvaluateImageAt( void, void* ); ^ /Users/Shared/OpenSource/VTK/IO/vtkTIFFReader.cxx:829:47: error: 'GetInternalImage' is a protected member of 'vtkTIFFReader' unsigned int isize = TIFFScanlineSize(self->GetInternalImage()->Image); ^ In file included from /Users/Shared/OpenSource/VTK/IO/vtkTIFFReader.cxx:15: /Users/Shared/OpenSource/VTK/IO/vtkTIFFReader.h:114:26: note: declared protected here vtkTIFFReaderInternal GetInternalImage() { return this->InternalImage; } ^ /Users/Shared/OpenSource/VTK/IO/vtkTIFFReader.cxx:852:21: error: 'EvaluateImageAt' is a protected member of 'vtkTIFFReader' inc = self->EvaluateImageAt( image, ^ In file included from /Users/Shared/OpenSource/VTK/IO/vtkTIFFReader.cxx:15: /Users/Shared/OpenSource/VTK/IO/vtkTIFFReader.h:116:7: note: declared protected here int EvaluateImageAt( void, void* ); ^
Looking at where those errors occur reveals that they are in template functions inside of ReadTiledImage and ReadScanlineImage in the vtkTIFFReader.cxx file. These functions appear never to be used anywhere in the code but if they do get used then a compile error will be thrown at that point. The functions probably need to be moved to the vtkTIFFReader.h file instead of in the vtkTIFFReader.cxx file or the functions need to be removed if they are not being used at all.
I submitted a bug report to the clang project and got the following response:
http://llvm.org/bugs/show_bug.cgi?id=7737 This is a mistake in the vtkTIFFReader code. clang is much stricter about what is allowed inside templates, checking as much as it can. The checking which clang does is allowed by the standard.
In particular, the expression in question is not dependant on any template parameters, so it is legal for the compiler to check it when it first sees the template.
Currently I have #if 0 around the code in order for the vtkTiffReader to compile. GCC and Visual Studio continue to compile and pass all tests accordingly.
This is using 515:[mjackson@ferb:clang]$ clang --version clang version 2.8 (trunk 109582) Target: x86_64-apple-darwin9 Thread model: posi
Mike Jackson www.bluequartz.net Principal Software Engineer mike.jackson@bluequartz.net BlueQuartz Software Dayton, Ohio