[LLVMbugs] [Bug 18309] New: False positive: "Undefined or garbage value returned to caller"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Dec 22 08:35:01 PST 2013


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

            Bug ID: 18309
           Summary: False positive: "Undefined or garbage value returned
                    to caller"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: john at bass-software.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11774
  --> http://llvm.org/bugs/attachment.cgi?id=11774&action=edit
Simple test case

Using:
clang version 3.5 (trunk 197863)
Target: x86_64-unknown-linux-gnu
Thread model: posix

I'm getting a false positive "Undefined or garbage value returned to caller"
for a variable which is guaranteed to be written to in one of the 'case'
entries of a 'switch' statement.

Test case attached.  Note, that false positive is not given for a switch() on
enum values, but it is given for switch() on an int where two bits are masked
out.

Use: scan-build --use-analyzer <...>/bin/clang gcc -std=c99 -o test.o -c test.c

-- 
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/20131222/7fa3cf68/attachment.html>


More information about the llvm-bugs mailing list