[LLVMbugs] [Bug 14691] New: -Wunneeded-internal-declaration misfires

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Dec 21 11:39:46 PST 2012


             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: unassignedclangbugs at nondot.org
        ReportedBy: nicholas at mxc.ca
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This small C program:

  static void f(void) {}
  static void f(void);
  static void g(void) { f(); }
  int main(void) {
    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
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.

More information about the llvm-bugs mailing list