From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TUg0n-00019T-KS for qemu-devel@nongnu.org; Sat, 03 Nov 2012 11:51:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TUg0m-0003uH-CE for qemu-devel@nongnu.org; Sat, 03 Nov 2012 11:51:53 -0400 Received: from mail-da0-f45.google.com ([209.85.210.45]:34137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TUg0m-0003uA-6H for qemu-devel@nongnu.org; Sat, 03 Nov 2012 11:51:52 -0400 Received: by mail-da0-f45.google.com with SMTP id n15so1998782dad.4 for ; Sat, 03 Nov 2012 08:51:51 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <50953D90.1010002@redhat.com> Date: Sat, 03 Nov 2012 16:51:44 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1351867404-25510-1-git-send-email-pbonzini@redhat.com> <509527DF.6040801@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 0/5] Fixes for thread pool patches. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Peter Maydell , qemu-devel@nongnu.org, jan.kiszka@siemens.com Il 03/11/2012 16:26, Blue Swirl ha scritto: >> > It's a clang bug. The error should be suppressed, since the function is >> > used with the weak alias. >> > >> > Or try if adding "|| defined __clang__" to compiler.h fixes it. > It does. Yeah, I tested now Clang/Linux myself and reported it as http://llvm.org/bugs/show_bug.cgi?id=14250. With a simple testcase such as this: static int g() { return 42; } typeof(g) f __attribute__((__weak__, __alias__("g"))); it's easy to see that the function is actually emitted---and with "g" as the name, even: .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 > Maybe __APPLE__ should be replaced by __clang__, or can the > problem also occur with GCC on Apple systems? It can occur with GCC, though it will be just a "note" if I understand correctly and not fail with -Werror. No idea whether the generated code would run, probably not. My favorite fix is to just disable the warning, otherwise make the function inline. Paolo