[cfe-dev] [patch] Add an attribute to reduce spurious memory leak warnings

Andrew McGregor andrewmcgr at gmail.com
Wed Jun 16 21:48:04 PDT 2010


The static analyser has no concept that ownership of memory may pass
elsewhere when a pointer is passed to certain functions.  So, I added an
attribute, provisionally called analyzer_free, to tell the analyzer to treat
a function argument as 'free' for the purposes of malloc analysis.
 Effectively this makes the memory somebody else's problem.

Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100617/61acc1fa/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-attribute_free.patch
Type: text/x-patch
Size: 11655 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100617/61acc1fa/attachment.bin>


More information about the cfe-dev mailing list