[LLVMbugs] [Bug 14250] New: incorrect -Wunneeded-internal-declaration warning with weak symbols

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Nov 3 08:47:51 PDT 2012


             Bug #: 14250
           Summary: incorrect -Wunneeded-internal-declaration warning with
                    weak symbols
           Product: clang
           Version: 3.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: bonzini at gnu.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This file:

static int g()
    return 42;
typeof(g) f __attribute__((__weak__, __alias__("g")));

compiled with -Wall gives:

g2.c:3:12: warning: function 'g' is not needed and will not be emitted

even though the function is emitted:

    .file    "g2.c"
    .align    16, 0x90
    .type    g, at function
g:                                      # @g
# BB#0:
    movl    $42, %eax
    .size    g, .Ltmp0-g

    .weak    f
f = g
    .section    ".note.GNU-stack","", at progbits

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