From patchwork Fri Aug 7 03:47:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 504982 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C81991402A7 for ; Fri, 7 Aug 2015 13:47:18 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=waVN3Yyn; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id; q=dns; s=default; b=OuWaqAfppxa9QtO SVqEGCEAT/MKQ2WT42meKZKVw7SRlcrTEyu+YC6qGdk1mC3P2FpyVmhGPH+5EzGx bC9Rog82bOksU9fARzXRKbCFf2n6w9co3ofTIRw4I2NTSn0gO2FFg9o424NbtHQ3 BXW6oSr24x6oDeARdpRwDf0gNGyA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id; s=default; bh=AMDWDIxYOfO/QYE+8Ghfl KWc/ho=; b=waVN3Yyno0pqQ2WF/ZSMw1iO5TKlcnrNS68IJvPvmYrTiTOUUQR9O lWVyRoFQuXf0EO2bQl8CCQ1twRHV/ySMAykjJ4ICtAj5ccv2XGKcFbmwednq2/3M agcpCbXxLcNOz5DeEFkoMI59RxF1G/xDDhqOoC/ATXq+uZ+Lk6ajA8= Received: (qmail 7836 invoked by alias); 7 Aug 2015 03:47:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 7822 invoked by uid 89); 7 Aug 2015 03:47:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 07 Aug 2015 03:47:10 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 78A08340CF1 for ; Fri, 7 Aug 2015 03:47:08 +0000 (UTC) From: Mike Frysinger To: gcc-patches@gcc.gnu.org Subject: [PATCH] cfns: fix mismatch in gnu_inline attributes Date: Thu, 6 Aug 2015 23:47:06 -0400 Message-Id: <1438919226-30427-1-git-send-email-vapier@gentoo.org> Since the 3.0.3 release of gperf (made in May 2007), the generated func has had the gnu_inline attribute applied to it. The gcc source however has not been updated to include that which has lead to a mismatch. In practice, this hasn't been an issue for two reasons: (1) Before gcc-5, the default standard was (gnu) C89, and gcc does not warn or throw an error in this mode. (2) Starting with gcc-4.8, the compiler driver used to build gcc was changed to C++, and g++ does not warn or throw an error in this mode. This error does show up though when using gcc-5 to build gcc-4.7 or older as then the default is (gnu) C11 and the C compiler driver is used. That failure looks like: In file included from .../gcc-4.7.4/gcc/cp/except.c:990:0: cfns.gperf: At top level: cfns.gperf:101:1: error: 'gnu_inline' attribute present on 'libc_name_p' cfns.gperf:26:14: error: but not here Whether the compiler should always emit this error regardless of the active standard or compiler driver is debatable (I think it should be consistent -- either always do it or never do it). 2015-08-06 Mike Frysinger * cfns.gperf [__GNUC__, __GNUC_STDC_INLINE__]: Apply the __gnu_inline__ attribute. * cfns.h: Regenerated. --- gcc/cp/cfns.gperf | 3 +++ gcc/cp/cfns.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf index 68acd3d..953262f 100644 --- a/gcc/cp/cfns.gperf +++ b/gcc/cp/cfns.gperf @@ -22,6 +22,9 @@ __inline static unsigned int hash (const char *, unsigned int); #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif const char * libc_name_p (const char *, unsigned int); %} diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h index 1c6665d..6d00c0e 100644 --- a/gcc/cp/cfns.h +++ b/gcc/cp/cfns.h @@ -53,6 +53,9 @@ __inline static unsigned int hash (const char *, unsigned int); #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif const char * libc_name_p (const char *, unsigned int); /* maximum key range = 391, duplicates = 0 */