<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>you are right of course, not thinking correctly. that makes things a lot easier.</div><br><div><div>On 17 Dec 2012, at 18:52, Jordan Rose <<a href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 17, 2012, at 9:48 , Richard <<a href="mailto:tarka.t.otter@googlemail.com">tarka.t.otter@googlemail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">well, the idea is to set state if a branch condition is checking for availability, eg<br><br>if ([foo respondsToSelector:@selector(onlyAvailableInIOS6:)]) {<br>  // set availability version<br>  doIOS6Stuff();<br>else {<br>  // issue a warning here<br>  doIOS6Stuff();<br>}<br><br>so a warning can be issued if there is are any methods used newer than the minimum deployment target that are being used without checking for their availability.<br><br>clearly here the state has to be cleared at the end of if {}, otherwise the checker will just assume that all successive calls in the graph have checked for availability already. what would you suggest as a good way of clearing the state once the ifstmt is complete?<br></blockquote></div><br><div>Well, no, it doesn't <i>have</i> to be. If I write this:</div><div><br></div><div></div><blockquote type="cite"><div>if ([foo respondsToSelector:@selector(onlyAvailableInIOS6:)]) {</div><div>  doIOS6Stuff();</div><div>}</div><div><br></div><div>doMoreIOS6Stuff();</div></blockquote><br><div>The call to 'doMoreIOS6Stuff' will be analyzed twice: once along the true-path from the if-statement, and once along the false-path. So you'd still get a warning on the false path, even though the true path would be quiet. And this is actually what you want for the early return case:</div><div><br></div><div></div><blockquote type="cite"><div>if (![foo respondsToSelector:@selector(onlyAvailableInIOS6:)])</div><div>  return;</div><div>doIOS6Stuff();</div></blockquote><br><div><br></div></div></blockquote></div><br></body></html>