[LLVMbugs] [Bug 12387] New: Call of function should be annotated if branch decision is important for warning
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Mar 28 09:26:42 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=12387
Bug #: 12387
Summary: Call of function should be annotated if branch
decision is important for warning
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P
Component: Static Analyzer
AssignedTo: kremenek at apple.com
ReportedBy: roland at utk.edu
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Given:
void f1(int* i) {
if (i!=0) //0a
++*i;
}
void f2(int* i) {
++*i; //2
}
void g(int* i) {
f1(i);
//if (i!=0) ++*i; //0b
f2(i); //1
}
only the calling of f2 (1) and the possible null pointer (2) are annotated.
This is a bit confusing because the branch decision (0a) which caused the
analyzer to check for null isn't annotated. This problem occurs only with a
branch decision within a function call because if the branch decision is within
the same function (0b) than this line is annotated with "Taking false branch".
I think having the bran decision annotated helps a lot in understanding the
thinking of the analyzer in more complex cases and thus it would be great if
this would be done also for (important) branches within sub-functions.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list