[LLVMbugs] [Bug 7764] New: Initialized fields not tracked across inline functions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jul 30 14:04:12 PDT 2010


           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: kremenek at apple.com
        ReportedBy: tjw at omnigroup.com
                CC: llvmbugs at cs.uiuc.edu

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.

More information about the llvm-bugs mailing list