[llvm-bugs] [Bug 24980] New: Clang's unused variable warnings somewhat lame compared to gcc

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 28 15:31:13 PDT 2015


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

            Bug ID: 24980
           Summary: Clang's unused variable warnings somewhat lame
                    compared to gcc
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: chisophugis at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

r248747 fixed an unused variable caught by GCC, but missed by clang.

The line that was detected by GCC as unused was:

    ArrayRef<uint8_t> Jmp = {0xff, 0x25};


However, clang even fails for trivial cases like this:

struct Foo {
  Foo() {}
};

void foo() {
  Foo Jmp;
}

I think what's happening here is that GCC is getting quite a bit of analysis
here "for free" since it isn't maintaining the clear frontend/optimizer
separation. This suggests that bringing clang up to parity for this unused var
detection is actually going to be quite difficult, as many analyses will have
to be replicated in the frontend. Not to mention that it is going to cost us a
fair amount of runtime.

-- 
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/20150928/c1f7ebeb/attachment.html>


More information about the llvm-bugs mailing list