From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E44D143AFE; Mon, 12 Feb 2024 22:49:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A28D340E54; Mon, 12 Feb 2024 22:49:26 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 4B58F40E03 for ; Mon, 12 Feb 2024 22:49:23 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 6437820B2004; Mon, 12 Feb 2024 13:49:22 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6437820B2004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1707774562; bh=dJJMXcqf0zJRknUtoy3Mh6JgLX8ljgAVXZ1fFxDG5mk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XtVoa7NiEApHIwjgb3XlCBF6SdDBgwCYIsTPjyv7rgp3BvIzvXBIl2XXtayGkcWz0 temYCd6EYfKXPSOFb0c1i3C5fhwvWvkKGJ2OzrM7VJxWB0CZC627sHPmLfieuB0qI5 Zpxyh22yvOQfJ8divlNwrJjigGx9hRFXqTYgKIkg= From: Tyler Retzlaff To: dev@dpdk.org Cc: Anatoly Burakov , Ashish Gupta , Chenbo Xia , Cristian Dumitrescu , David Hunt , Fan Zhang , Hemant Agrawal , Honnappa Nagarahalli , Jasvinder Singh , Jerin Jacob , Konstantin Ananyev , Maxime Coquelin , Reshma Pattan , Sachin Saxena , Sivaprasad Tummala , Srikanth Yalavarthi , Stephen Hemminger , Sunil Kumar Kori , Tyler Retzlaff Subject: [PATCH 04/15] cmdline: use GCC and MSVC common VA ARGS extension Date: Mon, 12 Feb 2024 13:49:06 -0800 Message-Id: <1707774557-16012-5-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707774557-16012-1-git-send-email-roretzla@linux.microsoft.com> References: <1707774557-16012-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use ... and forward with __VA_ARGS__ instead of args... and args. Neither mechanism is conformant with the standard but the former works with both GCC and MSVC. Fix checkpatches warning about style while(0) -> while (0) Signed-off-by: Tyler Retzlaff --- lib/cmdline/cmdline_parse.c | 2 +- lib/cmdline/cmdline_parse_num.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cmdline/cmdline_parse.c b/lib/cmdline/cmdline_parse.c index b6d6dac..76a212d 100644 --- a/lib/cmdline/cmdline_parse.c +++ b/lib/cmdline/cmdline_parse.c @@ -16,7 +16,7 @@ #ifdef RTE_LIBRTE_CMDLINE_DEBUG #define debug_printf printf #else -#define debug_printf(args...) do {} while(0) +#define debug_printf(...) do {} while (0) #endif #define CMDLINE_BUFFER_SIZE 64 diff --git a/lib/cmdline/cmdline_parse_num.c b/lib/cmdline/cmdline_parse_num.c index 820af07..e849878 100644 --- a/lib/cmdline/cmdline_parse_num.c +++ b/lib/cmdline/cmdline_parse_num.c @@ -14,9 +14,9 @@ #include "cmdline_parse_num.h" #ifdef RTE_LIBRTE_CMDLINE_DEBUG -#define debug_printf(args...) printf(args) +#define debug_printf(...) printf(__VA_ARGS__) #else -#define debug_printf(args...) do {} while(0) +#define debug_printf(...) do {} while (0) #endif struct cmdline_token_ops cmdline_token_num_ops = { -- 1.8.3.1