Message ID | 1707774557-16012-1-git-send-email-roretzla@linux.microsoft.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 97A5C43AFE; Mon, 12 Feb 2024 22:49:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22F7440274; Mon, 12 Feb 2024 22:49:22 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 588E24026E for <dev@dpdk.org>; Mon, 12 Feb 2024 22:49:21 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 8A04920B2000; Mon, 12 Feb 2024 13:49:20 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8A04920B2000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1707774560; bh=9ixo59s/cwpt6BLLftE4CNiVmlUUwk3PoWHqoXzg9kQ=; h=From:To:Cc:Subject:Date:From; b=kio84QeSqITOQhR2J7naV/3CDVuKvaNGU+17qJjyZQMrKMSF851FkRAxMmfZQqPZs CF94pimCKmChOM84HEumRdR7l7dg5jVpUTCu1vf3f2RK0s1Axv2p7FMKDW1qsQngx9 od9gqTPDUuImghpO4LxL0AeMNayX3xbA76yM5TrI= From: Tyler Retzlaff <roretzla@linux.microsoft.com> To: dev@dpdk.org Cc: Anatoly Burakov <anatoly.burakov@intel.com>, Ashish Gupta <ashish.gupta@marvell.com>, Chenbo Xia <chenbox@nvidia.com>, Cristian Dumitrescu <cristian.dumitrescu@intel.com>, David Hunt <david.hunt@intel.com>, Fan Zhang <fanzhang.oss@gmail.com>, Hemant Agrawal <hemant.agrawal@nxp.com>, Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>, Jasvinder Singh <jasvinder.singh@intel.com>, Jerin Jacob <jerinj@marvell.com>, Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>, Maxime Coquelin <maxime.coquelin@redhat.com>, Reshma Pattan <reshma.pattan@intel.com>, Sachin Saxena <sachin.saxena@nxp.com>, Sivaprasad Tummala <sivaprasad.tummala@amd.com>, Srikanth Yalavarthi <syalavarthi@marvell.com>, Stephen Hemminger <stephen@networkplumber.org>, Sunil Kumar Kori <skori@marvell.com>, Tyler Retzlaff <roretzla@linux.microsoft.com> Subject: [PATCH 00/15] use GCC/MSVC compatible __VA_ARGS__ Date: Mon, 12 Feb 2024 13:49:02 -0800 Message-Id: <1707774557-16012-1-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
use GCC/MSVC compatible __VA_ARGS__
|
|
Message
Tyler Retzlaff
Feb. 12, 2024, 9:49 p.m. UTC
MSVC does not support GCC args... forwarding of args replace with ... and __VA_ARGS__ when forwarding. Both forms of forwarding are a compiler extension but the latter is supported by both MSVC and GCC. I have not been able to exhaustively test all versions of GCC so please provide feedback as appropriate. Tyler Retzlaff (15): eal: use GCC and MSVC common VA ARGS extension bpf: use GCC and MSVC common VA ARGS extension cfgfile: use GCC and MSVC common VA ARGS extension cmdline: use GCC and MSVC common VA ARGS extension ip_frag: use GCC and MSVC common VA ARGS extension compressdev: use GCC and MSVC common VA ARGS extension metrics: use GCC and MSVC common VA ARGS extension mldev: use GCC and MSVC common VA ARGS extension net: use GCC and MSVC common VA ARGS extension pdump: use GCC and MSVC common VA ARGS extension power: use GCC and MSVC common VA ARGS extension rawdev: use GCC and MSVC common VA ARGS extension rcu: use GCC and MSVC common VA ARGS extension stack: use GCC and MSVC common VA ARGS extension vhost: use GCC and MSVC common VA ARGS extension lib/bpf/bpf_impl.h | 4 ++-- lib/cfgfile/rte_cfgfile.c | 4 ++-- lib/cmdline/cmdline_parse.c | 2 +- lib/cmdline/cmdline_parse_num.c | 4 ++-- lib/compressdev/rte_compressdev_internal.h | 4 ++-- lib/eal/common/eal_trace.h | 8 ++++---- lib/ip_frag/ip_frag_common.h | 4 ++-- lib/metrics/rte_metrics_telemetry.c | 12 ++++++------ lib/mldev/rte_mldev.h | 4 ++-- lib/net/rte_net_crc.c | 4 ++-- lib/pdump/rte_pdump.c | 4 ++-- lib/power/power_common.h | 6 +++--- lib/rawdev/rte_rawdev_pmd.h | 18 +++++++++--------- lib/rcu/rte_rcu_qsbr.c | 4 ++-- lib/rcu/rte_rcu_qsbr.h | 12 ++++++------ lib/stack/stack_pvt.h | 16 ++++++++-------- lib/vhost/vhost.h | 8 ++++---- lib/vhost/vhost_crypto.c | 14 +++++++------- 18 files changed, 66 insertions(+), 66 deletions(-)
Comments
On Mon, Feb 12, 2024 at 01:49:02PM -0800, Tyler Retzlaff wrote: > MSVC does not support GCC args... forwarding of args replace > with ... and __VA_ARGS__ when forwarding. Both forms of > forwarding are a compiler extension but the latter is supported > by both MSVC and GCC. > > I have not been able to exhaustively test all versions of GCC so > please provide feedback as appropriate. > > Tyler Retzlaff (15): > eal: use GCC and MSVC common VA ARGS extension > bpf: use GCC and MSVC common VA ARGS extension > cfgfile: use GCC and MSVC common VA ARGS extension > cmdline: use GCC and MSVC common VA ARGS extension > ip_frag: use GCC and MSVC common VA ARGS extension > compressdev: use GCC and MSVC common VA ARGS extension > metrics: use GCC and MSVC common VA ARGS extension > mldev: use GCC and MSVC common VA ARGS extension > net: use GCC and MSVC common VA ARGS extension > pdump: use GCC and MSVC common VA ARGS extension > power: use GCC and MSVC common VA ARGS extension > rawdev: use GCC and MSVC common VA ARGS extension > rcu: use GCC and MSVC common VA ARGS extension > stack: use GCC and MSVC common VA ARGS extension > vhost: use GCC and MSVC common VA ARGS extension > Series-acked-by: Bruce Richardson <bruce.richardson@intel.com>
> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] > Sent: Monday, 12 February 2024 22.49 > > MSVC does not support GCC args... forwarding of args replace > with ... and __VA_ARGS__ when forwarding. Both forms of > forwarding are a compiler extension but the latter is supported > by both MSVC and GCC. Series-acked-by: Morten Brørup <mb@smartsharesystems.com>
12/02/2024 22:49, Tyler Retzlaff: > MSVC does not support GCC args... forwarding of args replace > with ... and __VA_ARGS__ when forwarding. Both forms of > forwarding are a compiler extension but the latter is supported > by both MSVC and GCC. You use the non-standard ", ## __VA_ARGS__" which would not compile in pedantic modes, and possibly with other compilers. I remember a private chat where I recommended you to use this: lib/eal/include/rte_common.h /** * ISO C helpers to modify format strings using variadic macros. * This is a replacement for the ", ## __VA_ARGS__" GNU extension. * An empty %s argument is appended to avoid a dangling comma. */ #define RTE_FMT(fmt, ...) fmt "%.0s", __VA_ARGS__ "" #define RTE_FMT_HEAD(fmt, ...) fmt #define RTE_FMT_TAIL(fmt, ...) __VA_ARGS__ Why not using it?