[LLVMbugs] [Bug 22696] New: False positive on bit field access

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 25 06:52:23 PST 2015


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

            Bug ID: 22696
           Summary: False positive on bit field access
           Product: clang
           Version: 3.5
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: rino4work at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13943
  --> http://llvm.org/bugs/attachment.cgi?id=13943&action=edit
False positive case

Analyzer reports garbage value when accessing bit field:

clang --analyze -Xanalyzer -analyzer-output=text source.c 
source.c:13:5: warning: Undefined or garbage value returned to caller
    return (*(field_t*) &val).field2; 
    ^      ~~~~~~~~~~~~~~~~~~~~~~~~~
source.c:13:5: note: Undefined or garbage value returned to caller
    return (*(field_t*) &val).field2; 
    ^      ~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

-- 
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/20150225/b5a9f858/attachment.html>


More information about the llvm-bugs mailing list