• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: warning: control reaches end of non-void function when using @synchronized
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Shaun Wexler <email@hidden>
  • Date: Thu, 7 Sep 2006 13:41:13 -0700

On Sep 7, 2006, at 10:17 AM, 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];
   }
}

I may be thinking to much like Java but this seems like an incorrect
warning... I will file a defect shortly unless folks point out an
issue with the code.

It's a compiler/language bug. FTA, I wanted to point out that code should spend the shortest time possible within critical sections. If there's something that you can perform outside of the synchronized block, do it before/after.


- (BlahParticipant *)getFirstOrganizer
{
    BlahParticipant *firstCopy;
    @synchronized(self) {
        firstCopy = [firstOrganizer copy];
    }
    return [firstCopy autorelease];
}

--
Shaun Wexler
MacFOH
http://www.macfoh.com

Efficiency is intelligent laziness.


_______________________________________________ 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
  • Follow-Ups:
    • Re: Re: warning: control reaches end of non-void function when using @synchronized
      • From: "Shawn Erickson" <email@hidden>
References: 
 >warning: control reaches end of non-void function when using @synchronized (From: "Shawn Erickson" <email@hidden>)

  • Prev by Date: Re: Using gcc 4.0 to target 10.3.9 which SDK do I use?
  • Next by Date: Re: Resolving EXC_BAD_INSTRUCTION (Where do I begin?)
  • Previous by thread: Re: Re: warning: control reaches end of non-void function when using @synchronized
  • Next by thread: Re: Re: warning: control reaches end of non-void function when using @synchronized
  • Index(es):
    • Date
    • Thread