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

             Bug #: 14691
           Summary: -Wunneeded-internal-declaration misfires
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


This small C program:

  static void f(void) {}
  static void f(void);
  static void g(void) { f(); }
  int main(void) {
    g();
    return 0;
  }

has a bad warning when building with -Wall:

x.c:1:13: warning: function 'f' is not needed and will not be emitted
[-Wunneeded-internal-declaration]
static void f() {}
            ^
1 warning generated.

Actually, no, f() is needed and will be emitted. The redeclaration is
unnecessary, but that isn't what's being warned about.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to