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 3A78F428D0; Thu, 6 Apr 2023 02:46:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CCD7342D3B; Thu, 6 Apr 2023 02:45:30 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id EEDF742BB1 for ; Thu, 6 Apr 2023 02:45:22 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 9AA98210DF05; Wed, 5 Apr 2023 17:45:21 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9AA98210DF05 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1680741921; bh=UdRl6E4dhDfTdvJ/Ndp/1r/2c9CLJI/CsNAgZ1wnSmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c9rV3Poq+iPGFOwEbXc7dfDWluT4RgkpxHv/tiJq8Z9cDmPpq1uMJAziLzJ6vT0h9 8lTH+zMQsFCTv65IHvlyu/Gn6hT6yJFV8xMMX9c2Us8ZbRoxB4FcWjSz3nQqPcZmxp P8j0nIalHDn57gmj1RUm29WuYNObxg5fZNgIRsOk= 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 v3 10/11] telemetry: disable json print formatting with msvc Date: Wed, 5 Apr 2023 17:45:18 -0700 Message-Id: <1680741919-22102-11-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1680741919-22102-1-git-send-email-roretzla@linux.microsoft.com> References: <1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com> <1680741919-22102-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