• 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: returning from within @synchronized results in warnings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: returning from within @synchronized results in warnings


  • Subject: RE: returning from within @synchronized results in warnings
  • From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
  • Date: Wed, 12 Aug 2009 10:40:11 -0400
  • Thread-topic: returning from within @synchronized results in warnings

Ken Thomases wrote on Wednesday, August 12, 2009 9:00 AM

> On Aug 12, 2009, at 7:26 AM, Paul Summermatter wrote:
>
> > 	I'm a reborn Objective-C'er, but so take my advice as
> probably not
> > the most experienced since synchronized was not even available the
> > last time I used Objective-C.  That being said, I would
> have expected
> > to see something more like:
> >
> > - (NSString *)name
> > {
> > 	NSString *retval;
> >
> > 	@synchronized (self) {
> > 		retval = [[name retain] autorelease];
> > 	}
> >
> > 	return retval;
> > }
>
> The above will satisfy the compiler and eliminate the
> spurious warning, but Cem's original code was just as correct
> and, IMHO, acceptable style.  It shouldn't provoke that
> warning.  The problem is that the compiler doesn't seem to
> understand that the @synchronized block is unconditional.
> It's imagining that code might reach a point after the
> @synchronized block and execution will fall out of the
> function without returning any value.

<<SNIP>>

OK, so this warning is a bug; can someone test it out on the latest
version of Xcode?  I'm in the middle of a project and don't have time to
deal with any breakages, so I'm not upgrading anytime soon.  If its
already fixed in the latest version, then I won't worry about it,
otherwise I'll file a bug.

Thanks,
Cem Karan
 _______________________________________________
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: returning from within @synchronized results in warnings
      • From: Ken Thomases <email@hidden>
References: 
 >returning from within @synchronized results in warnings (From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>)
 >Re: returning from within @synchronized results in warnings (From: Paul Summermatter <email@hidden>)
 >Re: returning from within @synchronized results in warnings (From: Ken Thomases <email@hidden>)

  • Prev by Date: RE: returning from within @synchronized results in warnings
  • Next by Date: Re: returning from within @synchronized results in warnings
  • Previous by thread: Re: returning from within @synchronized results in warnings
  • Next by thread: Re: returning from within @synchronized results in warnings
  • Index(es):
    • Date
    • Thread