[LLVMbugs] [Bug 12325] New: Wrong CFG for statement expression causes -Wuninitialized false positive

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 21 14:52:06 PDT 2012


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

             Bug #: 12325
           Summary: Wrong CFG for statement expression causes
                    -Wuninitialized false positive
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: matthewbg at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Much to my regret, this is reduced from real code:

int foo(int params) {
  int x = ({
    while (false)
      ;
    int _v = params;
    if (false)
      ;
    _v; 
  });
  return x;
}

/tmp/test.ii:8:5: warning: variable '_v' is uninitialized when used here
[-Wuninitialized]
    _v;
    ^~

In the CFG for 'foo', if I'm reading it right, the block with the
initialization of '_v' is unreachable, yet the use of '_v' to initialize 'x' is
reachable.

-- 
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