[LLVMbugs] [Bug 17948] New: False positive: Value stored is never read

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Nov 15 11:52:17 PST 2013


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

            Bug ID: 17948
           Summary: False positive: Value stored is never read
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: immanuel.litzroth at cloudfounders.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This code triggers a warning:
> clang-problems.cpp:, Clang (LLVM based), Priority: Normal
> Value stored to 'i' is never read. 
Value is read in another thread.

>>
struct Test
{
public:
    Test(bool& i_bool)
        : the_bool(i_bool)
    {}

    void
    run()
    {
        while(the_bool);
    }
    bool& the_bool;
};

void
schedule_test(Test* t)
{
    // puts it on a queue that is handled in another thread
    (void)t;
}

void f()
{
    bool i = false;
    Test* t = new Test(i);
    schedule_test(t);
    i = true;
    // wait for threadpool to become empty
}

-- 
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/20131115/afaba09e/attachment.html>


More information about the llvm-bugs mailing list