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

             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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    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
      [-Wunneeded-internal-declaration]

even though the function is emitted:

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


    .weak    f
f = g
    .section    ".note.GNU-stack","",@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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to