[llvm-bugs] [Bug 32768] New: Missing "-Wuninitialized" warning after adding a no-op `(void)` cast

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 24 07:13:24 PDT 2017


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

            Bug ID: 32768
           Summary: Missing "-Wuninitialized" warning after adding a no-op
                    `(void)` cast
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vittorio.romeo at outlook.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

The following code won't produce a `-Wuninitialized` for `a`:

    int main()
    {
        int *a;
        (void) &a;

        *a = 4;
        return 0;
    }

---

The following code will produce a `-Wuninitialized` for `a`:

    int main()
    {
        int *a;
        // (void) &a;

        *a = 4;
        return 0;
    }

-- 
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/20170424/bd10f765/attachment.html>


More information about the llvm-bugs mailing list