From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F3D90A04C9; Mon, 14 Sep 2020 10:43:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 430AD1C0C2; Mon, 14 Sep 2020 10:43:49 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id F37261BE95 for ; Mon, 14 Sep 2020 10:43:46 +0200 (CEST) IronPort-SDR: a3XzyhDHI4/9OtAVcnlM4pxuc39VGt3e8MJCp3zSNq2zwDC/7zAiNA9aOaoDpz+e3CmE2VJa68 28V+tH2RXP2g== X-IronPort-AV: E=McAfee;i="6000,8403,9743"; a="243875799" X-IronPort-AV: E=Sophos;i="5.76,425,1592895600"; d="scan'208";a="243875799" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2020 01:43:45 -0700 IronPort-SDR: dkUSDOm2Rj1/O5nNim4z2rNVGUTTXYHrU3+6DO1sPFH2Nah5Aa8KhqiMXo80k5XgaAiILVPjiL uAzWpROp62yA== X-IronPort-AV: E=Sophos;i="5.76,425,1592895600"; d="scan'208";a="482255098" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.7.231]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 14 Sep 2020 01:43:44 -0700 Date: Mon, 14 Sep 2020 09:43:41 +0100 From: Bruce Richardson To: Stephen Hemminger Cc: dev@dpdk.org Message-ID: <20200914084341.GD737@bricha3-MOBL.ger.corp.intel.com> References: <20200911190701.29171-1-stephen@networkplumber.org> <20200911190701.29171-2-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200911190701.29171-2-stephen@networkplumber.org> Subject: Re: [dpdk-dev] [PATCH 01/15] eal: add macro to mark macros as deprecated X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Sep 11, 2020 at 12:06:47PM -0700, Stephen Hemminger wrote: > Add a macro that causes GCC and CLANG to emit a warning when > a deprecated macro is used. > > Signed-off-by: Stephen Hemminger > --- > lib/librte_eal/include/rte_common.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h > index 8f487a563dfc..1ade136b64e4 100644 > --- a/lib/librte_eal/include/rte_common.h > +++ b/lib/librte_eal/include/rte_common.h > @@ -86,6 +86,17 @@ typedef uint16_t unaligned_uint16_t; > /******* Macro to mark functions and fields scheduled for removal *****/ > #define __rte_deprecated __attribute__((__deprecated__)) > > +/** > + * Macro to mark macros and defines scheduled for removal > + */ > +#if defined(RTE_CC_GCC) || defined(RTE_CC_CLANG) > +#define RTE_PRAGMA(x) _Pragma(#x) > +#define RTE_PRAGMA_WARNING(w) RTE_PRAGMA(GCC warning #w) > +#define RTE_DEPRECATED(o, n) RTE_PRAGMA_WARNING(#o is deprecated use #n) > +#else > +#define RTE_DEPRECATED(o, n) > +#endif > + > /** > * Mark a function or variable to a weak reference. > */ Great to see this, as this is something I was looking for myself recently too! Acked-by: Bruce Richardson