[vtkusers] VTK Warnings
bill.hoffman at kitware.com
Fri Sep 8 23:55:25 EDT 2000
Because of the reference counting in VTK, all VTK objects must
be allocated on the heap with VTK Class::New calls.
The empty bodies exist because it is a way to make the
copy constructor protected. This prevents users from
attempting to create VTK objects on the stack or pass them
by value. If you leave them out of the class altogether,
then the compiler will provide public default implementations
for them. The warnings should be fixed weather they are
in the .h or the .cxx.
At 09:48 PM 9/8/00 -0500, Kent Vander Velden wrote:
> Using gcc 2.95.2 with VTK 3.1.2 with warnings enabled it becomes
>really difficult to sort out the warnings in the user program from
>those in VTK. This is because each class in VTK has an empty copy
>constructor that does not initialization. Do these empty bodies even
>need to exist? They don't with gcc 2.95.2 but I am not sure about
>other compilers. They should never be used so there should be no need
>to have their bodies. Perhaps an alternative to the short cut of
>placing this blank body in the header would be to put it in the source
>file. Then, users of VTK would not see the warnings and the constructor
>is still defined.
More information about the vtkusers