On 27 May 2015, at 11:00, Jonathan Taylor <jonathan.tay...@glasgow.ac.uk> wrote: >> Of course, it’s only a runtime check, but it’s better than nothing. Sure >> would be fine if the Static Analyzer could be made to understand KVO and >> threading and complain about such uses. > > I have a suspicion that if you can get the static analyzer to understand that > then you have probably solved a number of officially Hard problems along the > way!
Was thinking more of making it mark certain calls it knows aren’t thread-safe as such, and marking every method that is passed to detachNewThreadSelector: or the likes as “threaded”, and then warning if the former is used inside or in a call hanging off the latter. That sounds like it would lie well within the abilities of the static analyzer. But I’m not saying I know that would work. I’m really just saying it “Sure would be fine” :-) Sounds like a heuristic that might work if it doesn’t give too many false positives and is kept conservative, though. Doesn’t have to catch all cases, as long as it catches a few and avoids false positives. Cheers, -- Uli Kusterer “The Witnesses of TeachText are everywhere...” http://zathras.de _______________________________________________ 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