[LLVMbugs] [Bug 17861] New: False positive "Function call argument is an uninitialized value" after assigning through another, equivalent struct pointer when using bitfields

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Nov 8 20:11:54 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=17861

            Bug ID: 17861
           Summary: False positive "Function call argument is an
                    uninitialized value" after assigning through another,
                    equivalent struct pointer when using bitfields
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: dougie.richardson at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11504
  --> http://llvm.org/bugs/attachment.cgi?id=11504&action=edit
Xcode project demonstrating problem

I have two structs, both packed and 12 bytes long. One struct uses bitfield and
the other does not. If I take a pointer to the first struct, and then pass it
to a function that in turn casts it to a pointer to the second struct and
initializes the values, the static analyzer reports the values are
uninitialized.

The attached Xcode project demonstrates the problem.

I was able to workaround the problem by creating a union that contains the two
structs and passing that around instead.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131109/360c571b/attachment.html>


More information about the llvm-bugs mailing list