Re: Tiger Build Warnings
Re: Tiger Build Warnings
- Subject: Re: Tiger Build Warnings
- From: Jeff Moore <email@hidden>
- Date: Wed, 22 Jun 2005 18:06:06 -0700
In general, I like to see warnings from my compilers. They usually
point out potential problems. However, in this particular case, the
warning is a little off-base.
AUElementCreator does not inherit from any other classes, has no
member fields, and has no member functions that aren't pure virtual.
In other words, it is an abstract base class. It's job it to define
an interface. In fact, it is specifically meant to be a mix-in class.
Such a class does not need a destructor, let alone a virtual one. It
just doesn't accomplish anything to call it.
One might even argue that having to define a virtual destructor in
this case is actually bad since it takes away the compiler's ability
to optimize the un-named function completely away, which is what
happens since it won't get any code generated to call it when a sub-
class's destructor is generated.
On Jun 22, 2005, at 5:22 PM, Ben Cox wrote:
On Jun 22, 2005, at 5:44 PM, Jeff Moore wrote:
/Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/
AUScopeElement.h:335: warning: 'class AUElementCreator' has
virtual functions but non-virtual destructor
Ignore this one. AUElementCreator is a pure virtual class with a
no-op destructor. IMHO, gcc should not be issuing the warning in
this case, but I don't know enough about the details of the C++
spec to say if this is a bug in gcc.
It's not; it's a bug in AUElementCreator. Any class designed for
inheritance that doesn't have a virtual destructor is one that
contains a bug. GCC is trying to help you here.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden