From patchwork Fri Sep 11 19:06:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 77468 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 687E1A04C0; Fri, 11 Sep 2020 21:07:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CADB81C0D5; Fri, 11 Sep 2020 21:07:13 +0200 (CEST) Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by dpdk.org (Postfix) with ESMTP id 701921C0CF for ; Fri, 11 Sep 2020 21:07:12 +0200 (CEST) Received: by mail-pf1-f178.google.com with SMTP id v196so8228727pfc.1 for ; Fri, 11 Sep 2020 12:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=944hVpD44yJqTNt6dTXB6ueRgbyGgWTL9TcgnQUNpvs=; b=dzu9BWsonX4Y6R9BOGVm7Ua/5497n59MtGX8TXt3152ynzfKRJ2lH72q8BTUo9jD4m 9PKQC6+FCBgYvumjkFFOQ7XAZCFgjbn3QVsynEqZMhVibB6NnMby7OggUryFKbTzczBf kLN37fdIeq467GLTdEfGCHCO62lkDFYEUbk/a+CK+8kczn0KXi5pq8cWhypsKnePwEyC MkffnYaTX3WnyJtj3SvSLK/r8YwI/Bl3l4z65egnTr0JlJGOEz/I2McjyImnaF/bLSP+ 06Dz98dQZhvM6dUhZZGStsP0rW4CeApTISg/lJ8hkGRSC651JKqPfYMKl1UqmfzfLE4q RzIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=944hVpD44yJqTNt6dTXB6ueRgbyGgWTL9TcgnQUNpvs=; b=SuXfOVRijnEiRc0gGVDOmcs9McZn0plZ0BwncH4IfEnq+jl75UbnIbU5bmDhcekKt/ MQsmLayEZ/FXgo1xR6qVLPtImpn5CAjVDBSHdbfoeYDYZ4lPddYUKfpN8Y1k51S5C3MW egu1Y2teryoqGfWz1P6JVybV5fvCJDFw8LbQ+DslE7zedvwQPL/BiXDwARO8ryfzEJ/m R3ywfuXsl4qeVJWZyTGhpqLfwsjQV99SMBd37cQs9BzJL9Guq0dcD0/+2V8bhbIkvacE P7MgjhKE/XxqTLYY3ACzo+s0ZuExnUzuihdgne3xJZcM21UTCV0RtpOt3l3JlQItMPlu sPyA== X-Gm-Message-State: AOAM53341US5U4FwPtvZyLt1ckjkgGEy65FY35BhNr/6ZqDTrSWLdLw6 pvD3w3HubHKY/eyUIHouAGp65wGRkc8UhA== X-Google-Smtp-Source: ABdhPJwRs6le1nXWoYMvifcSGFoR0rZl5oAcfRsvjHTic4L+gKXi4ixRg0hiEBz2tnWOLsqVf2L19Q== X-Received: by 2002:a17:902:ab92:: with SMTP id f18mr3504331plr.12.1599851230861; Fri, 11 Sep 2020 12:07:10 -0700 (PDT) Received: from hermes.corp.microsoft.com (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id z23sm2979984pfg.220.2020.09.11.12.07.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 12:07:10 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Fri, 11 Sep 2020 12:06:47 -0700 Message-Id: <20200911190701.29171-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200911190701.29171-1-stephen@networkplumber.org> References: <20200911190701.29171-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [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" Add a macro that causes GCC and CLANG to emit a warning when a deprecated macro is used. Signed-off-by: Stephen Hemminger Acked-by: Bruce Richardson --- 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. */