[LLVMbugs] [Bug 13087] New: false positive in -Wunneeded-internal-declaration

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jun 11 17:49:50 PDT 2012


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

             Bug #: 13087
           Summary: false positive in -Wunneeded-internal-declaration
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


$ cat test.cc

static void concrete() {}
static void alias();

extern __typeof(concrete) alias __attribute__((alias("concrete")));

void test(void (*fptr1)(void), void (*fptr2)(void)) {
  fptr1 = &concrete;
  fptr2 = &alias;
}

$ clang test.cc -Wunneeded-internal-declaration -Werror
test.cc:2:13: error: function 'alias' has internal linkage but is not defined
      [-Werror]
static void alias();
            ^
test.cc:8:12: note: used here
  fptr2 = &alias;
           ^
1 error generated.


Two things: firstly that's a false-positive. It is defined because it is
declared with the alias attribute. Second, there no -Wflagname attached.

-- 
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