[vtkusers] VTK Warnings

Kent Vander Velden graphix at iastate.edu
Sat Sep 9 01:02:02 EDT 2000


  Yes, I am aware of the reasons.  However, at least with gcc 2.95.2,
the _bodies_ do not need to be defined.  Even if another compiler needs
the bodies defined, define them in the .cxx file and save the users the
hundreds of warnings.  If the constructors are never called, then there is
no problem with not implementing complete copy constructors, but please
don't put them inline in the header files.

  Thanks.

In message <4.3.2.7.2.20000908234737.00dd5320 at pop.nycap.rr.com>, Bill Hoffman w
rites:
>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.
>
>-Bill
>
>
>
>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.
>
>

---
Kent Vander Velden
kent at iastate.edu




More information about the vtkusers mailing list