<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;">Currently, there is no such supported mechanism. This is something that would be a great addition to the checker though.<div><br></div><div>The way to do this, would be by adding annotations to custom allocators/deallocators. This effort has been started. There is an experimental alpha.unix.MallocWithAnnotations checker that relies on ownership attributes. However, the checker is not production ready and it will error on the side of false positives. Specifically, when any function that takes a pointer is called, it will assume that it cannot free the pointer unless annotated. This approach would require a ton of annotations on user code and we need to change that behavior.</div><div><br></div><div>Cheers,</div><div><div><div>Anna.</div><div>On Jul 12, 2013, at 12:22 AM, Grissiom <<a href="mailto:chaos.proton@gmail.com">chaos.proton@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;"><div dir="ltr">Hi all,<div><br></div><div>I'm doing embedded programming and want to use clang to do some static analyze with the code. One problem I'm facing is we use custom memory allocater in the project, namely "rt_malloc" etc. Is there any way to make clang check such calls just like normal malloc without writing my own plugin?</div><div><br></div><div>I've checked cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp and I know I could substitute  "malloc" with "rt_malloc" and compile that file as so libs. But I think it's an overkill. Is there anyway to tell clang that "rt_malloc" is just an alias of "malloc"?<br clear="all"><div><br></div>--<span class="Apple-converted-space"> </span><br>Cheers,<br>Grissiom</div></div>_______________________________________________<br>cfe-users mailing list<br><a href="mailto:cfe-users@cs.uiuc.edu">cfe-users@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users</a></div></blockquote></div><br></div></body></html>