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 94514428BC; Tue, 4 Apr 2023 22:08:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7879942D2F; Tue, 4 Apr 2023 22:07:38 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id C2112410FB for ; Tue, 4 Apr 2023 22:07:30 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 5844C210DEAA; Tue, 4 Apr 2023 13:07:29 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5844C210DEAA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1680638849; bh=UdRl6E4dhDfTdvJ/Ndp/1r/2c9CLJI/CsNAgZ1wnSmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JVUAgYkev57lGHATq0uQv4ebTZegSzKFq68CAwUGXzNkAmffKMMWet8JwCzhuyR/C dl4Y5ffCjQ5OKWu+WCuKdJz8tb5yLjcabjzBW1Wi2jh9GeBr71UJamBIeDiuUFmfdz dB76ZFNrHQ154tKoPLMsWLkOLfjedSYVGu/MHqIo= From: Tyler Retzlaff To: dev@dpdk.org Cc: bruce.richardson@intel.com, david.marchand@redhat.com, thomas@monjalon.net, mb@smartsharesystems.com, konstantin.ananyev@huawei.com, Tyler Retzlaff Subject: [PATCH v2 8/9] telemetry: disable json print formatting with msvc Date: Tue, 4 Apr 2023 13:07:26 -0700 Message-Id: <1680638847-26430-9-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1680638847-26430-1-git-send-email-roretzla@linux.microsoft.com> References: <1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com> <1680638847-26430-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