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

             Bug #: 14091
           Summary: Version: xcode 4.5.1 release -- dead code in switch
                    before first case not flagged.
           Product: clang
           Version: 3.1
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


Code in switch block before first case is "dead", but not flagged by analyzer.

Example:

switch(1)
    {

    int x = 3; // variable will not be initialized
    NSLog(@"code Executed"); // code will not be executed

        case 1:
             NSLog(@"case:");
        break;
    }

-- result is "case:" because code inside switch block before first case is not
executed. 

Analyzer does correctly notice if a variable at the top of the switch is used
uninitialized.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to