Re: warning: control reaches end of non-void function when using @synchronized
Re: warning: control reaches end of non-void function when using @synchronized
- Subject: Re: warning: control reaches end of non-void function when using @synchronized
- From: AgentM <email@hidden>
- Date: Thu, 7 Sep 2006 13:42:15 -0400
On Sep 7, 2006, at 13:17 , Shawn Erickson wrote:
(...finally getting time to look into some minor issues I ran into
over the last few months, anyway...)
I use @synchronized in Objective-C++ built with Xcode 2.3 (using
ggc-4.0 [1] and have objective-c exceptions enabled) and I get
"warning: control reaches end of non-void function" when I specify
-Wall for the following code.
- (BlahParticipant*) getFirstOrganizer
{
@synchronized (self) {
return [[firstOrganizer copy] autorelease];
}
You can't synchronize up the call stack. This is probably what you want:
- (BlahParticipant*) getFirstOrganizer
{
id ret;
@synchronized (self) {
ret= [[firstOrganizer copy] autorelease];
}
return ret;
}
_______________________________________________
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