<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Clang static analyzer reports different line numbers in command line vs. html file."
href="http://llvm.org/bugs/show_bug.cgi?id=19827">19827</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang static analyzer reports different line numbers in command line vs. html file.
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.4
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Static Analyzer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>kremenek@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>hiraditya@msn.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>cat test.cpp
unsigned int *gp;
int foo(unsigned int argc) {
int* p = new int[10];
unsigned int i = 100;
gp = &i;
if (argc>*p)
return i;
return *p;
}
clang++ -cc1 -analyze -analyzer-checker=security,unix,core,alpha
-analyzer-output html -o report-dir/ -x c++ test.cpp
------------------Command line output----------------------
test.cpp:13:3: warning: Potential leak of memory pointed to by 'p'
return *p;
^~~~~~~~~
test.cpp:14:1: warning: Address of stack memory associated with local variable
'i' is still referred to by the global variable 'gp' upon returning to the
caller. This will be a dangling reference
}
--------------------html output------------------
Bug Summary
File: test.cpp
Location: line 12, column 12 <------- vs. 13:1 from the command line
Description: Potential leak of memory pointed to by 'p'</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>