From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9B695A00C2; Tue, 25 Jan 2022 11:33:14 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7EFAC42921; Tue, 25 Jan 2022 11:33:14 +0100 (CET) Received: from mail-108-mta206.mxroute.com (mail-108-mta206.mxroute.com [136.175.108.206]) by mails.dpdk.org (Postfix) with ESMTP id 0547D426D8 for ; Tue, 25 Jan 2022 11:33:12 +0100 (CET) Received: from filter006.mxroute.com ([140.82.40.27] 140.82.40.27.vultr.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta206.mxroute.com (ZoneMTA) with ESMTPSA id 17e90cbea3a0005a20.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Tue, 25 Jan 2022 10:33:09 +0000 X-Zone-Loop: 78f3d67b7605eadac8f1330922ae46e81579680f7372 X-Originating-IP: [140.82.40.27] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ashroe.eu; s=x; h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to:Subject:Cc:To: From:References:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=oOvpvCCrexUh74ufiu88aXerhbzFGmPrUQ7SoDFZRJU=; b=Z1/qvDq45lofbDECCSr/uS+BZ1 ugttEuTZ1lfsCmXP9F6zG9dT+7sLwfrUxTZCtZkF/f0NalWn4OPn1zk8qNTA1ZLZyfcF2I6j0IjCo 3NLJL4h2ZWNbY58qRXXyXze7RuWL/0I9ahAiC50hjKJxLauDojkQuY//yW27j97IH0NKlkkmzfrgK sZPk8wEOinRcW2mbFf6W00SIsieLIdQyqWh+EAt9cHnzz0LU26cGmTxDCcU4VQ9HqGOrW7WuAJ/Sx JTCQuKzH6xrjTG8KT1z/TiN3PcgCGmGdrtJOlHBHpBjLv2pegtZAg+wAyb1Lu2kUEpAWbCDSWdVtf 59lvuPcg==; References: <20220123210751.19182-1-mikeb01@gmail.com> <20220123212024.19747-1-mikeb01@gmail.com> User-agent: mu4e 1.4.15; emacs 27.1 From: Ray Kinsella To: Michael Barker , Stephen Hemminger Cc: dev@dpdk.org Subject: Re: [PATCH v4] Add pragma to ignore gcc-compat warnings in clang when used with diagnose_if. In-reply-to: <20220123212024.19747-1-mikeb01@gmail.com> Date: Tue, 25 Jan 2022 05:33:06 -0500 Message-ID: <87h79srtp9.fsf@mdr78.vserver.site> MIME-Version: 1.0 Content-Type: text/plain X-AuthUser: mdr@ashroe.eu X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Michael Barker writes: > When compiling with clang using -Wall (or -Wgcc-compat) the use of > diagnose_if kicks up a warning: > > .../include/rte_interrupts.h:623:1: error: 'diagnose_if' is a clang > extension [-Werror,-Wgcc-compat] > __rte_internal > ^ > .../include/rte_compat.h:36:16: note: expanded from macro '__rte_internal' > __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \ > > This change ignores the '-Wgcc-compat' warning in the specific location > where the warning occurs. It is safe to do in this circumstance as the > specific macro is only defined when using the clang compiler. > > Signed-off-by: Michael Barker > --- > lib/eal/include/rte_compat.h | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/lib/eal/include/rte_compat.h b/lib/eal/include/rte_compat.h > index 2718612cce..9556bbf4d0 100644 > --- a/lib/eal/include/rte_compat.h > +++ b/lib/eal/include/rte_compat.h > @@ -33,8 +33,11 @@ section(".text.internal"))) > #elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /* > For clang */ Why doesn't the __has_attribute take care of this? I would have thought that gcc would check the for the attribute, find it doesn't support it and ignore the whole thing? > > #define __rte_internal \ > +_Pragma("GCC diagnostic push") \ > +_Pragma("GCC diagnostic ignored \"-Wgcc-compat\"") \ > __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \ > -section(".text.internal"))) > +section(".text.internal"))) \ > +_Pragma("GCC diagnostic pop") > > #else -- Regards, Ray K