On Sat, 18 Feb 2012 16:45:56 -0800, Greg Parker <gpar...@apple.com> said:

>Precisely. clang now warns about this case (or will soon; I don't know which 
>release of Xcode has this).
>
>test.m:9:33: warning: variable 'x' is uninitialized when captured by block 
>[-Wuninitialized]
>    id x = [Foo methodWithBlock:^{ return x; }];

Yes, the static analyzer catches that now (even in an Xcode as old as Snow 
Leopard Xcode 4.2). That was a *huge* help to me in arriving at the correct 
formulation. m.

--
matt neuburg, phd = m...@tidbits.com, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 5! http://shop.oreilly.com/product/0636920023562.do
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to