http://llvm.org/bugs/show_bug.cgi?id=7764
Summary: Initialized fields not tracked across inline functions
Product: clang
Version: trunk
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: Static Analyzer
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Created an attachment (id=5298)
--> (http://llvm.org/bugs/attachment.cgi?id=5298)
test case
A fairly common pattern is to initialize rect.origin.x and then use
NSMinX(rect) later. But, checker-246 warns about this saying that other fields
in the struct aren't initialized. Strictly speaking this is correct, but since
the NS{Min,Max}{X,Y} functions are inlines, it could track that no use of
uninitialized values will actually happen.
rect-uninitialized-field.m:11:33: warning: Passed-by-value struct argument
contains uninitialized data (e.g., via the field chain: 'size.height')
r.size.height = NSMaxY(b) - NSMinY(r);
^ ~
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