[llvm-bugs] [Bug 26647] New: False positive - Switch statement analysis assumes default cannot be taken

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 17 01:22:36 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26647

            Bug ID: 26647
           Summary: False positive - Switch statement analysis assumes
                    default cannot be taken
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: avi.bugzilla at mail.ashevin.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15915
  --> https://llvm.org/bugs/attachment.cgi?id=15915&action=edit
Sample code illustrating bug

When an enumerated type is used as a bit mask, the analyzer assumes that
covering all the individual enumeration values precludes reaching the default
case.  This can lead to warnings of unused initializations.

In the attached sample code, the analyzer warns that "bc" is initialized, but
not read.  The output of the program correctly logs "BC".

(Please forgive the extraneous bits.  The sample code is used for quick testing
of ideas.)

-- 
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/20160217/d5bfd0b3/attachment.html>


More information about the llvm-bugs mailing list