Re: Disable "missing [super dealloc] call" warning
Re: Disable "missing [super dealloc] call" warning
- Subject: Re: Disable "missing [super dealloc] call" warning
- From: George Warner <email@hidden>
- Date: Mon, 02 May 2005 09:39:50 -0700
On Sat, 30 Apr 2005 19:15:50 +0200, Axel Andersson <email@hidden>
wrote:
>>> Is there a flag or build setting to disable the "method possibly
>>> missing a [super dealloc] call" warning? I don't seem to be able
>>> to find it in either Xcode or gcc(1).
>>
>> What exactly are you doing in the code that is causing the warning
>> to be raised?
>
> Not that it matters what I'm doing, but I'm overriding a class
> completely, and I don't want to let it run its own -dealloc method.
>
> For the record, after reading Apple's gcc sources (objc/objc-act.c),
> there is no flag to disable the warning.
What you can do is fake out the compiler so that it thinks that you might be
calling the [super dealloc]:
if (false) {
[super dealloc]
}
Note that if the compiler optimizes this code out (because it's always
false) before it checks for the warning then you'll still get the warning.
In that case you could use this code instead:
// this should NEVER be true (unless you have an error! ;-)
if (noErr != errorno) {
[super dealoc]
}
Note that errno is a macro that calls a procedure (not the variable that it
appears to be) so the compiler will not optimize this code out.
--
Enjoy,
George Warner,
Schizophrenic Optimization Scientist
Apple Developer Technical Support (DTS)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden