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 F344C428C0; Mon, 3 Apr 2023 18:30:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 17DEE42B71; Mon, 3 Apr 2023 18:30:30 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 7495440ED7 for ; Mon, 3 Apr 2023 18:30:26 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 925B5210CBEC; Mon, 3 Apr 2023 09:30:25 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 925B5210CBEC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1680539425; bh=J/w0juR/Qh7aR/O/9S5k+flJ8crTbWVTzb74CNRWMsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SZHW0yPprAR0VfvL3FWslUKvWgQ4CRMEvpu+r+LCwc728g/anqga92r7V9hFrLk/0 6I/gcHo5c9pvJHaSHIbjaWZJBLii10l7hQVcPpS3alduxU2TzUz+jtBBCyF55SZA2h G3/dQ/15YvN2QmrKXNk8g48fttxeJkvv2PaECR0I= From: Tyler Retzlaff To: dev@dpdk.org Cc: ciara.power@intel.com, bruce.richardson@intel.com, david.marchand@redhat.com, thomas@monjalon.net, Tyler Retzlaff Subject: [PATCH 2/2] telemetry: use portable syntax to initialize array Date: Mon, 3 Apr 2023 09:30:24 -0700 Message-Id: <1680539424-20255-3-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1680539424-20255-1-git-send-email-roretzla@linux.microsoft.com> References: <1680539424-20255-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 Use of ranges in designated initialization are a non-standard gcc extension. Manually expand the ranges used in designated initialization to eliminate the use of non-standard features. Signed-off-by: Tyler Retzlaff --- lib/telemetry/telemetry_data.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/telemetry/telemetry_data.c b/lib/telemetry/telemetry_data.c index 2bac2de..87e5f18 100644 --- a/lib/telemetry/telemetry_data.c +++ b/lib/telemetry/telemetry_data.c @@ -152,12 +152,20 @@ static bool valid_name(const char *name) { - char allowed[128] = { - ['0' ... '9'] = 1, - ['A' ... 'Z'] = 1, - ['a' ... 'z'] = 1, - ['_'] = 1, - ['/'] = 1, + static const char allowed[128] = { + ['0'] = 1, ['1'] = 1, ['2'] = 1, ['3'] = 1, ['4'] = 1, + ['5'] = 1, ['6'] = 1, ['7'] = 1, ['8'] = 1, ['9'] = 1, + ['A'] = 1, ['B'] = 1, ['C'] = 1, ['D'] = 1, ['E'] = 1, + ['F'] = 1, ['G'] = 1, ['H'] = 1, ['I'] = 1, ['J'] = 1, + ['K'] = 1, ['L'] = 1, ['M'] = 1, ['N'] = 1, ['O'] = 1, + ['P'] = 1, ['Q'] = 1, ['R'] = 1, ['S'] = 1, ['T'] = 1, + ['U'] = 1, ['V'] = 1, ['W'] = 1, ['X'] = 1, ['Y'] = 1, + ['Z'] = 1, ['a'] = 1, ['b'] = 1, ['c'] = 1, ['d'] = 1, + ['e'] = 1, ['f'] = 1, ['g'] = 1, ['h'] = 1, ['i'] = 1, + ['j'] = 1, ['k'] = 1, ['l'] = 1, ['m'] = 1, ['n'] = 1, + ['o'] = 1, ['p'] = 1, ['q'] = 1, ['r'] = 1, ['s'] = 1, + ['t'] = 1, ['u'] = 1, ['v'] = 1, ['w'] = 1, ['x'] = 1, + ['y'] = 1, ['z'] = 1, ['_'] = 1, ['/'] = 1, }; while (*name != '\0') { if ((size_t)*name >= RTE_DIM(allowed) || allowed[(int)*name] == 0) -- 1.8.3.1