[LLVMbugs] [Bug 17558] New: "Uninitialized" warning disappears by taking an address

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Oct 11 18:55:30 PDT 2013


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

            Bug ID: 17558
           Summary: "Uninitialized" warning disappears by taking an
                    address
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mimomorin at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

In the following code, `x` is used without initialization;
however, doing `&x` removes "uninitialized" warning.
Tested on trunk (r192519).

#include <iostream>

int main()
{
    int x;

    // `(void)` is used to avoid "unused-value" warning
    (void)&x;

    // Missing "uninitialized" warning
    std::cout << x << std::endl;
}

-- 
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/20131012/a07cce4d/attachment.html>


More information about the llvm-bugs mailing list