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 E6B8E43875; Wed, 17 Jan 2024 18:27:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AFCCD4025E; Wed, 17 Jan 2024 18:27:29 +0100 (CET) Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) by mails.dpdk.org (Postfix) with ESMTP id 396AE4014F for ; Wed, 17 Jan 2024 18:27:28 +0100 (CET) Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-6e0a89b98e4so3358101a34.1 for ; Wed, 17 Jan 2024 09:27:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1705512447; x=1706117247; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ZqoJbLVXENBtzjDhaaU4xwkc1K/uelkUNxhLUfUZqPI=; b=qFeXH04TecmQf/U0vcEhYcIvr0XPfczgWprSfgwnzX7PPfp4w2KaJj9S5Dj0Qsc4ag FG9Jca2Wp3g3VvQEatUUe5of3D/VRyiIn29k/HRb7vqpNYYU//FPhij1AG4dE4xHKPCt J8Wg/b+ByPp9wLasYf6Vq6phqiLmQdzREwvPDmF5y7UhkaCBwPzVCX3YbUd/8ttKq47p //5bSD5WK5aeSN6RAVzPNmD0bQKVlb7PEq4LpB/fy0UBdMUel6tBrUP1LiPOLJBJY8+T tBgL2p7KvyNgPbpXgD31hu2mdqQfQxllp+6A3Apj0R79Je325VOQa16zD8JDP7qWqKMm fv2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705512447; x=1706117247; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZqoJbLVXENBtzjDhaaU4xwkc1K/uelkUNxhLUfUZqPI=; b=PSxdP5/8wxMuzxKw8S9Am4Djj6BQBdqb1JXq0S9tVPHrC886FQP+UcNCKSkL+rbI5y Sn1ePbrHnzPkHG4BVVh14v9EgR3DODnLv7EMt1O2mLAD+WqCbBiNaDdbgKR+rttwcjkJ Hhs84gmeA4+4NB8KUiOevMYS+NrXj+729y4NK9CuxFjui8NrzhGt3OIBet8zWt8ZQrmJ 1pOkRp7WMDZ1OrVDqchWSXLlD0jBVMwnqh0HCO89oD+eErfu1UcuDqQyegXUZY/nNICG 5moshEDRts9k2anVv8L38BPWfDbdZ85BGCCrR0DwGQU2psfHQo8hAaLJ0vIjmHuqNHFU aaQQ== X-Gm-Message-State: AOJu0YzBoEbWaE5Tjm7pDdqCeZ8NA63beWRYr4xGL4lQobCnGYUVDXph CgQZNLYU/5WhP8UPGKyq5FD0NzjfUlOI/Ikbx3aBGsGiZSjAxg== X-Google-Smtp-Source: AGHT+IEt5YFzbaMgAFxJqvTxpQhf2Lb44QD+e0CPiQG0GPvuDDZipYMUbxfMB7pDN26mvQESf4jBYg== X-Received: by 2002:a05:6358:189:b0:175:acca:e164 with SMTP id d9-20020a056358018900b00175accae164mr12186513rwa.41.1705512447420; Wed, 17 Jan 2024 09:27:27 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id i136-20020a636d8e000000b005cebb10e28fsm12052891pgc.69.2024.01.17.09.27.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 09:27:27 -0800 (PST) Date: Wed, 17 Jan 2024 09:12:35 -0800 From: Stephen Hemminger To: Andrew Rybchenko Cc: dev@dpdk.org, Morten =?UTF-8?B?QnLDuHJ1cA==?= , Tyler Retzlaff Subject: Re: [PATCH v3 5/5] eal: replace out of bounds VLA with static_assert Message-ID: <20240117091230.7f62cbe1@hermes.local> In-Reply-To: <38f6e4e7-b03c-4775-a02e-e3fe0771122c@oktetlabs.ru> References: <20231111172153.57461-1-stephen@networkplumber.org> <20240116184307.162882-1-stephen@networkplumber.org> <20240116184307.162882-6-stephen@networkplumber.org> <38f6e4e7-b03c-4775-a02e-e3fe0771122c@oktetlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 On Wed, 17 Jan 2024 10:52:40 +0300 Andrew Rybchenko wrote: > On 1/16/24 21:41, Stephen Hemminger wrote: > > Both Gcc, clang and MSVC have better way to do compile time > > assertions rather than using out of bounds array access. > > The old method would fail if -Wvla is enabled because compiler > > can't determine size in that code. Also, the use of new > > _Static_assert will catch broken code that is passing non-constant > > expression to RTE_BUILD_BUG_ON(). > >=20 > > Need to add brackets {} around the static_assert() to workaround > > a bug in clang. Clang was not handling static_assert() in > > a switch case properly. > >=20 > > Signed-off-by: Stephen Hemminger > > Acked-by: Morten Br=C3=B8rup > > Acked-by: Tyler Retzlaff =20 >=20 > Acked-by: Andrew Rybchenko >=20 > Does it imply any limitations on Gcc / Clang versions to > be used? Is it documented somewhere in DPDK? No new language versions problems. There are already direct usages of static_assert() in some drivers.