<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hi, Richard. "clang --analyze” is not intended to be a usual interface for the analyzer, merely an invocation that higher-level tools can use. The correct way to run the analyzer, even on a single file, is through the <a href="http://clang-analyzer.llvm.org/scan-build.html">scan-build</a> tool, which provides HTML output that shows you the full path to the purported bug. (Or through Xcode, of course, if you’re on a Mac.)</div><div><br></div><div>Sorry for the inconvenience,</div><div>Jordan</div><div><br></div><br><div><div>On Nov 12, 2013, at 11:56 , Richard <<a href="mailto:legalize@xmission.com">legalize@xmission.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">clang --analyze reports this problem in my code:<br><br>warning: Potential memory leak<br> for (extent_vector_iter deit = disk_.provided_extents.begin();<br> deit != disk_.provided_extents.end(); ++deit)<br> ^~<br>1 warning generated.<br><br>Context:<br><span class="Apple-tab-span" style="white-space:pre"> </span>typedef std::vector<extent_data> extent_vector;<br><span class="Apple-tab-span" style="white-space:pre"> </span>typedef extent_vector::const_iterator extent_vector_iter;<br><br><span class="Apple-tab-span" style="white-space:pre"> </span>extent_data has no raw pointers, only non-pointer POD types and other<br><span class="Apple-tab-span" style="white-space:pre"> </span>standard library classes like string and vector of string, etc.<br><br>The problem with this diagnostic is that it points to the place where<br>it thinks a memory leak may occur, but it doesn't provide me with a<br>chain of reasoning that makes me understand why it thinks this<br>particular chunk of code may leak memory.<br><br>Am I missing some magic flag to tell me this extra level of<br>information, or is that ability simply lacking?<br>-- <br>"The Direct3D Graphics Pipeline" free book <<a href="http://tinyurl.com/d3d-pipeline">http://tinyurl.com/d3d-pipeline</a>><br> The Computer Graphics Museum <<a href="http://ComputerGraphicsMuseum.org">http://ComputerGraphicsMuseum.org</a>><br> The Terminals Wiki <<a href="http://terminals.classiccmp.org">http://terminals.classiccmp.org</a>><br> Legalize Adulthood! (my blog) <<a href="http://LegalizeAdulthood.wordpress.com">http://LegalizeAdulthood.wordpress.com</a>><br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></body></html>