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 2BA2845E6F; Wed, 11 Dec 2024 03:06:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ADD5E4042E; Wed, 11 Dec 2024 03:06:18 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 4C15440611 for ; Wed, 11 Dec 2024 03:06:15 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id AE336204722C; Tue, 10 Dec 2024 18:06:14 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com AE336204722C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1733882774; bh=ymIlv1SKfJ2ldMtOFerqd2DngpbopEGkRif8pHnoSQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V2z+VuplquXIcigW977vltDgHfRqoriUbsAUcS2fQIAeR6Rhqw9DGFtX4ibRvAIwq Px1pl8TBFoV7IhF9esORFCJKXvK+1PcaNLBnHqXfbXGQ33ohPbfrh/ovOlErT2R0Gc JRL6kIiYwWnTccUVDdl20DRdacNhCxfYXTG8oYa8= From: Andre Muezerie To: Srikanth Yalavarthi Cc: dev@dpdk.org, Andre Muezerie Subject: [PATCH 03/21] app/test-mldev: use portable variadic macros Date: Tue, 10 Dec 2024 18:05:33 -0800 Message-Id: <1733882751-29598-4-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-mldev/ml_common.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/test-mldev/ml_common.h b/app/test-mldev/ml_common.h index 8d7cc9eeb7..45faed352c 100644 --- a/app/test-mldev/ml_common.h +++ b/app/test-mldev/ml_common.h @@ -14,11 +14,12 @@ #define ML_STR_FMT 20 -#define ml_err(fmt, args...) fprintf(stderr, CLRED "error: %s() " fmt CLNRM "\n", __func__, ##args) +#define ml_err(fmt, ...) \ + fprintf(stderr, CLRED "error: %s() " fmt CLNRM "\n", __func__, ##__VA_ARGS__) -#define ml_info(fmt, args...) fprintf(stdout, CLYEL "" fmt CLNRM "\n", ##args) +#define ml_info(fmt, ...) fprintf(stdout, CLYEL "" fmt CLNRM "\n", ##__VA_ARGS__) -#define ml_dump(str, fmt, val...) printf("\t%-*s : " fmt "\n", ML_STR_FMT, str, ##val) +#define ml_dump(str, fmt, ...) printf("\t%-*s : " fmt "\n", ML_STR_FMT, str, ##__VA_ARGS__) #define ml_dump_begin(str) printf("\t%-*s :\n\t{\n", ML_STR_FMT, str) -- 2.47.0.vfs.0.3