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 68BE4A0526; Wed, 22 Jul 2020 15:53:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ABD961BFBB; Wed, 22 Jul 2020 15:53:26 +0200 (CEST) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 4D70C199BC for ; Wed, 22 Jul 2020 15:53:25 +0200 (CEST) Received: by mail-pg1-f196.google.com with SMTP id n5so1292773pgf.7 for ; Wed, 22 Jul 2020 06:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D3Bt04v/P4t/vaHTbLTTbetlUEZyOsnjY+lQJ3WqnUo=; b=wEuR5omK67tP4Izr5Uh0jqnVgpTLyHNVWHEh5TPPxl1j3snmyKRI9phgHBYWQUE6DM Sk3Xu3AhWD/Nx7BxFNu5fqKDzhrksVRbIeqOh2MmrLxeXjScWTivWe6VQm17LwdJ7nqr FmDkmJIRXrlufZJgjh3w03MYGnnszTVmmovlS8GsxTz584NGD6cxDgGhwBQXfh0b6TUG dot62WYaAMOC0hbUGB3o3O2AxrKs5XP/K8LNoi4SHbJLYYUHYKpgkbqHMQYeRGjQ622m UO2oHXvkf1URUSjz4hUharEOnGqd567PLzcn/LmGFsBtgsSD+KR1F3JD7vUpT2r86WcN xrhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D3Bt04v/P4t/vaHTbLTTbetlUEZyOsnjY+lQJ3WqnUo=; b=FJv+6dmk0TEH0D8Y4m5ZHrlRIj+RKsvme1A4BIbmpa/djayiSIuqgKb0j5XUHYJASE F7l/Q4Mu+fnYWBYfpXlnPMUFHGX1vqycm5BsjuJrIzuiuGXuqYz8hdvYbxJLSFwhxvW4 1ceDBMvlghIQHpmK92oMgyH20bN0oreQVxJoXjNCxq+0C8LlDDnA3Ytq/SrpgeYdmiFj zggsDX9IoO3gVoba994e3toVKkzGICfKpG5T1A/r8ajYNBvOf2t6IO2/uQHMFiY6vGQG 0Mi3qWth1Iq/aqbTZ3cyaxyZ26Plc/2FQCGHVSI18il9aHLoQo7/Igk8tJk+D6PMkB80 AFXw== X-Gm-Message-State: AOAM5315pjlrCkDhjgcO0a9JYN8r7Tq+q3EQSyFsCCpS6Ia7Rt4u82bK C4FupM3K5N5NupANZT+ZoOotzg== X-Google-Smtp-Source: ABdhPJzTX89V3fuZy7kLyBbX/w/KWcmi55/FpdFGtbFzLp3ZGxjBf8POXOHRA5wYmHlFMzFq5N+1Zg== X-Received: by 2002:a62:d103:: with SMTP id z3mr27217875pfg.317.1595426004195; Wed, 22 Jul 2020 06:53:24 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id 83sm24291949pfu.60.2020.07.22.06.53.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 06:53:23 -0700 (PDT) Date: Wed, 22 Jul 2020 06:53:14 -0700 From: Stephen Hemminger To: "Burakov, Anatoly" Cc: dev@dpdk.org Message-ID: <20200722065314.40a38bf4@hermes.lan> In-Reply-To: References: <20200604210200.25405-1-stephen@networkplumber.org> <20200701202359.17006-1-stephen@networkplumber.org> <20200701202359.17006-26-stephen@networkplumber.org> <20200715132910.5aaa11ed@hermes.lan> <2e34fe08-6548-e474-a7bc-f10e4bef947a@intel.com> <20200716150429.664a524e@hermes.lan> <88cf6911-c0e5-1f37-5f2d-51232d8dc787@intel.com> <20200717192235.3636fcce@hermes.lan> <20200720115112.14ef4f5d@hermes.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 25/27] eal: mark old naming 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 Wed, 22 Jul 2020 10:05:09 +0100 "Burakov, Anatoly" wrote: > On 20-Jul-20 7:51 PM, Stephen Hemminger wrote: > > On Mon, 20 Jul 2020 13:32:27 +0100 > > "Burakov, Anatoly" wrote: > > > >> On 18-Jul-20 3:22 AM, Stephen Hemminger wrote: > >>> On Fri, 17 Jul 2020 16:21:37 +0100 > >>> "Burakov, Anatoly" wrote: > >>> > >>>> On 16-Jul-20 11:04 PM, Stephen Hemminger wrote: > >>>>> On Thu, 16 Jul 2020 14:41:41 +0100 > >>>>> "Burakov, Anatoly" wrote: > >>>>> > >>>>>> On 15-Jul-20 9:29 PM, Stephen Hemminger wrote: > >>>>>>> On Wed, 15 Jul 2020 14:28:17 +0100 > >>>>>>> "Burakov, Anatoly" wrote: > >>>>>>> > >>>>>>>>> -#define SKIP_MASTER SKIP_INITIAL > >>>>>>>>> -#define CALL_MASTER CALL_INITIAL > >>>>>>>>> +#define SKIP_MASTER _Pragma("GCC warning \"'SKIP_MASTER' is deprecated\"") SKIP_INITIAL > >>>>>>>>> +#define CALL_MASTER _Pragma("GCC warning \"'CALL_MASTER' is deprecated\"") CALL_INITIAL > >>>>>>>> > >>>>>>>> Presumably this is a generic header, should we introduce GCC-specific > >>>>>>>> things there? > >>>>>>> > >>>>>>> It works with Clang as well. Likely ICC but don't have that. > >>>>>>> > >>>>>> > >>>>>> What about MSVC? > >>>>>> > >>>>> > >>>>> _Pragma is C99 standard so MSVC know it. > >>>>> MSVC should ignore any pragman it doesn't understand. > >>>>> > >>>>> There is a better pragma for deprecating keywords in MSVC, but GCC and Clang don't > >>>>> understand it. > >>>>> > >>>> > >>>> Deprecating macros sounds like something we might want to do in the > >>>> future, can't we put some macro into rte_common.h to address this? e.g. > >>>> something like > >>>> > >>>> #ifdef MSVC > >>>> #define rte_deprecated_macro _msvc_pragma_whatever() > >>>> #else > >>>> #define rte_deprecated_macro _Pragma("GCC warning ...") > >>>> #endif > >>>> > >>>> and use this macro here? > >>> > >>> It gets hard to do macro in a macro, > >>> > >> > >> I don't have a strong opinion on this, but IMO it's certainly better > >> than having a compiler-specific things in an API header file :) > >> > > > > I was hoping for macro volunteer? > > > > Something like: > > #define RTE_DEPRECATED(foo) ... > > > > Oh, sure, apologies for not picking up on that :D > > A bit on the ugly side, but should work: > > #define __rte_deprecated_macro(val) (_Pragma("GCC warning \"'" #val "'\" > is deprecated\"") (val)) > > To be used as: > > #define NEW __rte_deprecated_macro(OLD) > > (I feel there could be confusion between __rte_deprecated and > RTE_DEPRECATED, so both for consistency and clarity, i believe > "__rte_deprecated_macro" would be a better name - however, no strong > opinion, RTE_DEPRECATED is fine by me as well) > I would prefer to keep to uppercase for macros. Will try it in V2