<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 28 Oct 2012, at 06:00, Ted Kremenek <<a href="mailto:kremenek@apple.com">kremenek@apple.com</a>> wrote:</div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div>Hi Richard,</div><div><br></div><div>I think it would be easy to add a warning that checks if a use API is newer than the minimum deployment target, but I would not want that warning to go into mainline Clang because (1) most developers would hate the warning as it would produce too many false positives and (2) I believe we can do much better than that.  While it might be "hard" to get it right, I think it is quite doable.</div><div><br></div><div>I'm curious about your last comment, that "unless a standard convention is used it is going to be almost impossible to do well."  Can you elaborate?  I thought there were standard conventions for checking for weak linked APIs, etc?</div><div><br></div><div>Cheers,</div><div>Ted</div></div></blockquote></div><br><div>hey ted,</div><div><br></div><div>perhaps you are right, maybe i was just being too lazy. the current documentation on using weakly linked apis is here:</div><div><br></div><div><a href="https://developer.apple.com/library/mac/#documentation/developertools/conceptual/cross_development/Using/using.html#//apple_ref/doc/uid/20002000-SW6">https://developer.apple.com/library/mac/#documentation/developertools/conceptual/cross_development/Using/using.html#//apple_ref/doc/uid/20002000-SW6</a></div><div><br></div><div>so maybe it is as simple as checking that every call to an api newer than the minimum deployment target is contained in a block like this example:</div><div><br></div><div>if ([UIImagePickerController instancesRespondToSelector:@selector (availableCaptureModesForCameraDevice:)]) {<br>    // Method is available for use.</div><div>} else {<br>    // Method is not available.</div><div>}</div><div><br></div><div>but i have the feeling there are some edge cases to take care of here, as well as handling C apis.</div></body></html>