From patchwork Tue Feb 9 18:49:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 8264961 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 67E959F4DD for ; Tue, 9 Feb 2016 18:55:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C150D20145 for ; Tue, 9 Feb 2016 18:55:12 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id ED7B520115 for ; Tue, 9 Feb 2016 18:55:11 +0000 (UTC) Received: from localhost ([::1]:59637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTDRP-0007eK-FB for patchwork-qemu-devel@patchwork.kernel.org; Tue, 09 Feb 2016 13:55:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTDMN-0008Q8-7d for qemu-devel@nongnu.org; Tue, 09 Feb 2016 13:50:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTDMJ-0003bV-Om for qemu-devel@nongnu.org; Tue, 09 Feb 2016 13:49:59 -0500 Received: from resqmta-po-07v.sys.comcast.net ([96.114.154.166]:38308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTDMJ-0003bK-Jx for qemu-devel@nongnu.org; Tue, 09 Feb 2016 13:49:55 -0500 Received: from resomta-po-19v.sys.comcast.net ([96.114.154.243]) by resqmta-po-07v.sys.comcast.net with comcast id GJpo1s0065FMDhs01JpuGp; Tue, 09 Feb 2016 18:49:54 +0000 Received: from red.redhat.com ([24.10.254.122]) by resomta-po-19v.sys.comcast.net with comcast id GJpo1s00j2fD5rL01Jptak; Tue, 09 Feb 2016 18:49:54 +0000 From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 9 Feb 2016 11:49:48 -0700 Message-Id: <1455043788-28112-1-git-send-email-eblake@redhat.com> X-Mailer: git-send-email 2.5.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1455043794; bh=wBNQnAvuaJCxIygK672Xls0HOH9+H8Hc79nbOcoFrR4=; h=Received:Received:From:To:Subject:Date:Message-Id; b=PpwajM1/PDRZOf2NJKm/T/aGFq2PX1onolT4kVSo6XX1UL5wnQXb0MLtS7zApV4+b a5QAM3FzYV0rvybl99QJAeIKITV+c4Waefchq51gJvEVRZl3fMQZvEkUnW7OuXz1y4 bp4kOfIRwqF4Wiltiw17c4RYL/QsTAB6+AHfARmerF4PBXEvMQQL6z7bUNmpr48Pku 3mi+h1Qi4GFXMixsIUrAfJ8ByzBvUL5H9MlZIqIARf6tSCAKiV7wHrDZ/wOK9TfFll dnYWwVjBgjJCMXW9saf61lfG8R1Ude3cecad7yGMhpFXJu9CVxJwN+BHLBHu7FbKGK 9rFOtSmMYj0hQ== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 96.114.154.166 Subject: [Qemu-devel] [PATCH] build: Don't redefine 'inline' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Actively redefining 'inline' is wrong for C++, where gcc has an extension 'inline namespace' which fails to compile if the keyword 'inline' is replaced by a macro expansion. This will matter once we start to include "qemu/osdep.h" first from C++ files, depending also on whether the system headers are new enough to be using the gcc extension. But rather than just guard things by __cplusplus, let's look at the overall picture. Commit df2542c737ea2 in 2007 defined 'inline' to the gcc attribute __always_inline__, with the rationale "To avoid discarded inlining bug". But compilers have improved since then, and we are probably better off trusting the compiler rather than trying to force its hand. So just nuke our craziness. Signed-off-by: Eric Blake Reviewed-by: Peter Maydell --- include/qemu/compiler.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index d22eb01..c5fbe28 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -77,18 +77,6 @@ #define typeof_field(type, field) typeof(((type *)0)->field) #define type_check(t1,t2) ((t1*)0 - (t2*)0) -#ifndef always_inline -#if !((__GNUC__ < 3) || defined(__APPLE__)) -#ifdef __OPTIMIZE__ -#undef inline -#define inline __attribute__ (( always_inline )) __inline__ -#endif -#endif -#else -#undef inline -#define inline always_inline -#endif - #define QEMU_BUILD_BUG_ON(x) \ typedef char glue(qemu_build_bug_on__,__LINE__)[(x)?-1:1] __attribute__((unused));