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 83D85428C3; Mon, 3 Apr 2023 23:53:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1718D42D29; Mon, 3 Apr 2023 23:52:46 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id D928D40ED7 for ; Mon, 3 Apr 2023 23:52:37 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id B4D96210DC7A; Mon, 3 Apr 2023 14:52:36 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B4D96210DC7A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1680558756; bh=UdRl6E4dhDfTdvJ/Ndp/1r/2c9CLJI/CsNAgZ1wnSmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lpghkKMsL456Qmz6BB9X9JZJQcDGrcNDVLJR/PFzJT8rcpyIC2BUBzxU7Ha/30ftc gBSgOJqnXNF1ZiAuC2xMM4mcx+b7SmIBuiMpbgghBvxrZ26qUYrB7+LJHVP4qBeqc3 dtHmY86lZKxxSXgLHpfKWep1wg10QBNg/RCblS+0= From: Tyler Retzlaff To: dev@dpdk.org Cc: bruce.richardson@intel.com, david.marchand@redhat.com, thomas@monjalon.net, mb@smartsharesystems.com, Tyler Retzlaff Subject: [PATCH 8/9] telemetry: disable json print formatting with msvc Date: Mon, 3 Apr 2023 14:52:30 -0700 Message-Id: <1680558751-17931-9-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com> References: <1680558751-17931-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 VLAs are unsafe and will never be implemented in MSVC. When compiling with MSVC just return immediately indicating 0 output characters formatted. For now telemetry doesn't work on Windows, we will revisit support for the telemetry library sometime after we establish the DPDK unit tests. Signed-off-by: Tyler Retzlaff --- lib/telemetry/telemetry_json.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/telemetry/telemetry_json.h b/lib/telemetry/telemetry_json.h index 744bbfe..d847003 100644 --- a/lib/telemetry/telemetry_json.h +++ b/lib/telemetry/telemetry_json.h @@ -30,6 +30,7 @@ static inline int __json_snprintf(char *buf, const int len, const char *format, ...) { +#ifndef RTE_TOOLCHAIN_MSVC char tmp[len]; va_list ap; int ret; @@ -41,6 +42,7 @@ strcpy(buf, tmp); return ret; } +#endif return 0; /* nothing written or modified */ } @@ -60,6 +62,7 @@ static inline int __json_format_str(char *buf, const int len, const char *prefix, const char *str, const char *suffix) { +#ifndef RTE_TOOLCHAIN_MSVC char tmp[len]; int tmpidx = 0; @@ -98,6 +101,9 @@ strcpy(buf, tmp); return tmpidx; +#else + return 0; +#endif } /* Copies an empty array into the provided buffer. */ -- 1.8.3.1