Re: Tiger Build Warnings
Re: Tiger Build Warnings
- Subject: Re: Tiger Build Warnings
- From: Ben Cox <email@hidden>
- Date: Thu, 23 Jun 2005 13:15:00 -0400
On Jun 23, 2005, at 11:18 AM, Steve Checkoway wrote:
this one.) Actually adding a virtual destructor as Richard
suggests would cause problems with the vtable layout, which would
interfere with COM-like use of the interface class.
How would that cause problems with the vtable layout and how would
that interfere with the COM-like use?
The virtual destructor has to be in the vtable somewhere. COM
expects a specific vtable layout, with the methods in a predictable
order and without extra vtable slots between an interface's methods
and those of a derived interface. Adding a virtual destructor
inserts such a slot, and furthermore does it in a compiler-specific
place, so in COM it is verboten.
So, I retract my comment last night that AUElementCreator
contained a bug. Sorry.
From the point of view of the c++ standard, it does contain a bug.
But not one that anyone will ever hit if they use the class
properly. (And if they don't, they'll have bigger problems than this.)
I thought there was a G++ attribute you could define (with
__attribute__) on the interface class to suppress the warning, but
I can't find it at the moment.
I can't imagine that you would want to suppress this warning. In
fact, I filed a bug with Apple to get this fixed 6 months or so
ago. It finally was with gcc 4.0.
In general it ought to be possible to suppress any warning once
you're sure you understand why the warning was issued and can
demonstrate to your satisfaction that the warning doesn't apply to
you. (MSVC is fine-grained enough that you can use a #pragma to turn
off a warning in your source, and then turn it back on again a few
lines later, which is kinda nice.) Many shops compile with "warnings
as errors" and then turn off the warnings that they expect and have
dealt with; this is generally considered a good practice.
The compiler wants to warn you whenever you point a gun at your foot,
but if you've ensured that the safety is on or the gun is unloaded,
it should be possible to say "yes I understand but I'm going to do it
anyway."
__
Ben Cox <email@hidden>
http://www.djehuti.com
_______________________________________________
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