[cfe-users] how to check custom malloc with the clang checker?

Grissiom chaos.proton at gmail.com
Fri Jul 12 00:22:49 PDT 2013

Hi all,

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

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"?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20130712/9dbbd84f/attachment.html>

More information about the cfe-users mailing list