http://llvm.org/bugs/show_bug.cgi?id=11839
Bug #: 11839
Summary: Static analyzer gives no warnings in #included *.c
files
Product: clang
Version: trunk
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P
Component: Static Analyzer
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
$ cat foo.c
int foo( void ) {
int x;
if ( x ) return 1; /* uninitialized */
return 0;
}
$ cat main.c
#include "foo.c" /* ignored by static analyzer? */
int main( void ) {
return 0;
}
$ clang main.c --analyze
$ clang --version
clang version 3.1 (trunk 148340)
Analysis of main.c is defective. Explicit analysis of foo.c does give a
warning.
$ clang foo.c --analyze
foo.c:3:10: warning: Branch condition evaluates to a garbage value
if ( x ) return 1; /* uninitialized */
^
1 warning generated.
--
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs