[cfe-dev] clang --analyze: how do I get more verbose diagnostics?

Richard legalize at xmission.com
Tue Nov 12 11:56:06 PST 2013


clang --analyze reports this problem in my code:

warning: Potential memory leak
        for (extent_vector_iter deit = disk_.provided_extents.begin();
             deit != disk_.provided_extents.end(); ++deit)
                                                   ^~
1 warning generated.

Context:
	typedef std::vector<extent_data> extent_vector;
	typedef extent_vector::const_iterator extent_vector_iter;

	extent_data has no raw pointers, only non-pointer POD types and other
	standard library classes like string and vector of string, etc.

The problem with this diagnostic is that it points to the place where
it thinks a memory leak may occur, but it doesn't provide me with a
chain of reasoning that makes me understand why it thinks this
particular chunk of code may leak memory.

Am I missing some magic flag to tell me this extra level of
information, or is that ability simply lacking?
-- 
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
     The Computer Graphics Museum <http://ComputerGraphicsMuseum.org>
         The Terminals Wiki <http://terminals.classiccmp.org>
  Legalize Adulthood! (my blog) <http://LegalizeAdulthood.wordpress.com>



More information about the cfe-dev mailing list