From patchwork Tue Jul 19 14:04:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 9237535 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2481360574 for ; Tue, 19 Jul 2016 14:05:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13BE126D19 for ; Tue, 19 Jul 2016 14:05:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07169272AA; Tue, 19 Jul 2016 14:05:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 790E326D19 for ; Tue, 19 Jul 2016 14:05:06 +0000 (UTC) Received: from localhost ([::1]:56304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPVdx-0004Jp-MI for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Jul 2016 10:05:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPVdg-0004Jh-W5 for qemu-devel@nongnu.org; Tue, 19 Jul 2016 10:04:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPVde-00057A-Sz for qemu-devel@nongnu.org; Tue, 19 Jul 2016 10:04:47 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:58360) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPVde-00053z-LL for qemu-devel@nongnu.org; Tue, 19 Jul 2016 10:04:46 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1bPVdV-0002vh-Rf; Tue, 19 Jul 2016 15:04:37 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 19 Jul 2016 15:04:36 +0100 Message-Id: <1468937076-21503-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH] disas: Fix ATTRIBUTE_UNUSED define clash with ALSA headers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: BALATON Zoltan , =?UTF-8?q?Llu=C3=ADs=20Vilanova?= , Stefan Hajnoczi , patches@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP disas/bfd.h defines ATTRIBUTE_UNUSED, but unfortunately the ALSA system headers also define this macro, which means that you can get a compilation failure if building with ALSA and any files happen to include the alsa headers before bfd.h rather than the other way around. This is unfortunate namespace pollution by the ALSA headers but we can work around it. Add an #ifndef guard to bfd.h and remove the unnecessary extra definition in disas/arm.c to fix this. Reported-by: BALATON Zoltan Signed-off-by: Peter Maydell Reviewed-by: Stefan Hajnoczi --- disas/arm.c | 1 - include/disas/bfd.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/disas/arm.c b/disas/arm.c index 32f8ca9..426270f 100644 --- a/disas/arm.c +++ b/disas/arm.c @@ -24,7 +24,6 @@ #include "qemu/osdep.h" #include "disas/bfd.h" -#define ATTRIBUTE_UNUSED __attribute__((unused)) #define ISSPACE(x) ((x) == ' ' || (x) == '\t' || (x) == '\n') #define ARM_EXT_V1 0 diff --git a/include/disas/bfd.h b/include/disas/bfd.h index 231e5fb..8a3488c 100644 --- a/include/disas/bfd.h +++ b/include/disas/bfd.h @@ -477,7 +477,9 @@ int generic_symbol_at_address(bfd_vma, struct disassemble_info *); (INFO).disassembler_options = NULL, \ (INFO).insn_info_valid = 0 +#ifndef ATTRIBUTE_UNUSED #define ATTRIBUTE_UNUSED __attribute__((unused)) +#endif /* from libbfd */