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 B37E145E6F; Wed, 11 Dec 2024 03:06:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96CB04064E; Wed, 11 Dec 2024 03:06:20 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 327CF4042E for ; Wed, 11 Dec 2024 03:06:15 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 8BC3B20BCAEA; Tue, 10 Dec 2024 18:06:14 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8BC3B20BCAEA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1733882774; bh=6nkiqjCDLnIC92c5S8Id7bHAmX8qIxyX1DDGEh3PFrQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bXCSxXhL6h34wOGqXBQn6ieK295ySZEdsWC5yO4dN9IganIT3xOo8lKMOSr8XbaJj jmbIEGUdojSCtB4sxiCQoNAplonobCa7RdrGpBVJSQbzjRRvRy04jrEiDVuz6N+Xwc 4V285mF0HSOglNGlsjfoUyJG2SLfZBN+UZPRPJaU= From: Andre Muezerie To: Jerin Jacob Cc: dev@dpdk.org, Andre Muezerie Subject: [PATCH 02/21] app/test-eventdev: use portable variadic macros Date: Tue, 10 Dec 2024 18:05:32 -0800 Message-Id: <1733882751-29598-3-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1733882751-29598-1-git-send-email-andremue@linux.microsoft.com> References: <1733882751-29598-1-git-send-email-andremue@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 Many places are using a GCC extension related to variadic macros, where a name prepends the ellipsis. This results in a warning like the one below when compiling the code with MSVC: app\test-pmd\testpmd.h(1314): error C2608: invalid token '...' in macro parameter list Variadic macros became a standard part of the C language with C99. GCC, Clang and MSVC handle them properly. The fix is to remove the prefix name (args... becomes ...) and use __VA_ARGS__. Signed-off-by: Andre Muezerie --- app/test-eventdev/evt_common.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h index 901b8ba55d..63b782f11a 100644 --- a/app/test-eventdev/evt_common.h +++ b/app/test-eventdev/evt_common.h @@ -18,16 +18,16 @@ #define CLGRN "\x1b[32m" #define CLYEL "\x1b[33m" -#define evt_err(fmt, args...) \ - fprintf(stderr, CLRED"error: %s() "fmt CLNRM "\n", __func__, ## args) +#define evt_err(fmt, ...) \ + fprintf(stderr, CLRED"error: %s() "fmt CLNRM "\n", __func__, ## __VA_ARGS__) -#define evt_info(fmt, args...) \ - fprintf(stdout, CLYEL""fmt CLNRM "\n", ## args) +#define evt_info(fmt, ...) \ + fprintf(stdout, CLYEL""fmt CLNRM "\n", ## __VA_ARGS__) #define EVT_STR_FMT 20 -#define evt_dump(str, fmt, val...) \ - printf("\t%-*s : "fmt"\n", EVT_STR_FMT, str, ## val) +#define evt_dump(str, fmt, ...) \ + printf("\t%-*s : "fmt"\n", EVT_STR_FMT, str, ## __VA_ARGS__) #define evt_dump_begin(str) printf("\t%-*s : {", EVT_STR_FMT, str) -- 2.47.0.vfs.0.3