From patchwork Tue Sep 15 15:10:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 77743 X-Patchwork-Delegate: thomas@monjalon.net 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 A2E8BA04C7; Tue, 15 Sep 2020 17:19:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2A5F91C10A; Tue, 15 Sep 2020 17:18:55 +0200 (CEST) Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by dpdk.org (Postfix) with ESMTP id 914AF1C0CE for ; Tue, 15 Sep 2020 17:18:52 +0200 (CEST) Received: by mail-oi1-f193.google.com with SMTP id x19so4293410oix.3 for ; Tue, 15 Sep 2020 08:18:52 -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=TW347TG8+8vnliSRqHOhvwfYMrDMlNXGr3eOwIH7jys=; b=M7HvdeAZenZc740nU1dbookGXNk38Xl4tPDXpbexy7gjyi/QhAjBnk8nDJr2FBDu4E k1HQ2kI1e/rkqPe0TfjInk3EgKqgLnb+tZA73d8mKowu+MxD4KVt4RRef+1cICrX3cjg QafS6qLjK0CWs0SAlvw9qD02SX4PLzq0BPGVCPGy8sAE3d/j1muLmEIsYfBHWFfwNDx2 xWIp7zAWJzZUtWjnGDyI1k9MM/7mqtx2VEOOskjFDuS5nILPAC6ltQiyW4y0nPJV6a3u 0BYuZKs5Vy97Da/HT86SM1tQ8829nMCMb2kauQVNyYmy3rgCSVhu/T13Xq3GTAm67DFm KgMA== 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=TW347TG8+8vnliSRqHOhvwfYMrDMlNXGr3eOwIH7jys=; b=Bl7ljc+5vDvhUQsR/vLbZZ1gb8O50gk4OD80vbhMwf24KoryqWC00v4DXeRZYZqHQ3 Sk+mVasBTxr83bB8kDs2oBWLONpbYXSRFOakj9mpddx1T6rO2ITmnHj9BuRDAwSNpQwE gE3uQ2ARPjixVfCn9PIssLaGVyW0BDyu+WglZpHkHMmyh64RSz9wKUsttrs2lafFZg1/ amCVIFMoXsZtF7yrSUXvImdC+G/pZV44f7vQyytdB9KT5zMwH0rJ8OqCjm052QXCxbyz LmXWbWT/7TGcglcBvOAfjLCRW3jzSJ18Dky7/CV+nKbzZageOKee6TETKj6YNTGm4vMm sH0g== X-Gm-Message-State: AOAM530vFk4nck6h27MujqCts09Xc+ICuAh5WOMypCnkeUiKQLwWfggQ mZtf25MO5BTEsR2PggztfKwBeBtQHfr4vg== X-Google-Smtp-Source: ABdhPJxQ08KmsENE4IAJguT6LeQ4TXcF12pvw57iZMaqfu2AkHK6YCDgLZ0hpeIzkeLQVRO2R01m+g== X-Received: by 2002:a17:90a:1188:: with SMTP id e8mr4586793pja.185.1600182686619; Tue, 15 Sep 2020 08:11:26 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id c127sm13742278pfa.165.2020.09.15.08.11.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 08:11:25 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Anatoly Burakov Date: Tue, 15 Sep 2020 08:10:59 -0700 Message-Id: <20200915151114.12024-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200915151114.12024-1-stephen@networkplumber.org> References: <20200911190701.29171-1-stephen@networkplumber.org> <20200915151114.12024-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 02/17] 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. Acked-by: Anatoly Burakov 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..c6714b67b411 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(x) RTE_PRAGMA_WARNING(#x is deprecated) +#else +#define RTE_DEPRECATED(x) +#endif + /** * Mark a function or variable to a weak reference. */