MantisBT - VTK
View Issue Details
0011051VTK(No Category)public2010-07-28 12:432016-08-12 09:55
Mike Jackson 
Kitware Robot 
normalblockalways
closedmoved 
 
 
0011051: vtkTIFFReader compile Error - calls protected method of vtkTiffReader from outside of class
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
No tags attached.
Issue History
2010-07-28 12:43Mike JacksonNew Issue
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:55Kitware RobotNote Added: 0037187
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0037187)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.