[LLVMbugs] [Bug 9930] New: false positive garbage value when set from cast.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 16 08:28:26 PDT 2011


           Summary: false positive garbage value when set from cast.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: kenny.macdermid at gmail.com
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=6600)
 --> (http://llvm.org/bugs/attachment.cgi?id=6600)
Example file generating error (gcc -O0 -std=c99)

When using a uint8_t and setting the value from with something like:
"((uint32_t *)randbuf)[i] = rand();" the static analyzer appears to think that
randbuf[2] is not set.

The reported error is: The left operand of '&' is a garbage value 

Attached are a test case and the generated report.

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