<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>Interesting. I don't think we've ever tried to stack ownership attributes, but this makes plenty of sense. Please file a bug with a standalone test case, though I can't promise we'll get to it any time soon. Meanwhile, you can disable the "unix.MismatchedDeallocator" checker until this is fixed.</div><div><br></div><div>(CCing Anton, who wrote most of unix.MismatchedDeallocator)</div><div>Jordan</div><br><div><div>On Apr 18, 2013, at 9:59 , Bruce Stephens <<a href="mailto:bruce.r.stephens@gmail.com">bruce.r.stephens@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">We have a wrapper around malloc (that usually calls abort if malloc<br>fails). That's easy: I can just add<br>__attribute((ownership_returns(malloc,1))).<br><br>We also have a wrapper around realloc. How can I annotate that? I tried<br>__attribute((ownership_returns(malloc,2)))<br>__attribute((ownership_takes(malloc,1)))<br><br>but that gives the error Memory allocated by wrap_malloc() should be<br>deallocated by free(), not wrap_realloc().<br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></div></blockquote></div><br></body></html>