<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Nov 26, 2011, at 10:42 PM, Jordy Rose wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">I don't like the idea of having duplicated code, or even shared code between MallocChecker and UnixAPIChecker. The two checkers really shouldn't know about each other, and in practical use I think it's rare for people to run the analyzer with MallocChecker enabled and UnixAPIChecker disabled.</span></blockquote><div><br></div><div>I completely agree.  This situation is not ideal.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "> I guess, even though there's duplicated work /now/, I'd leave it the original way. And maybe eventually we'll have a way to enable or disable certain checks in a checker, right? Then we can move the logic to MallocChecker where it belongs, even if we don't have IPA yet.<br></span></blockquote></div><br><div>Yes, that would be a good option.  Conceptually these two checkers are doing different checks.  UnixAPIChecker is checking function preconditions, while MallocChecker is checking allocation typestate.  The precondition checks for malloc() and friends should ideally be in MallocChecker, but we should have the ability to selectively enable parts of that checker (where it makes sense).</div></body></html>