From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB209C47DA9 for ; Wed, 17 Jan 2024 07:52:44 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E06B6402B0; Wed, 17 Jan 2024 08:52:43 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id C62E3402A6 for ; Wed, 17 Jan 2024 08:52:41 +0100 (CET) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 162B750; Wed, 17 Jan 2024 10:52:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 162B750 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1705477961; bh=P3jEepfnAXUusJ3x9X22Uorf4MJmlbcPMVave+WWYBw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=w5VWKX3+XDphcr70EI8/DAjYS/QrrOD1d5l/ixkBb00M3ScNLRlCCKGgGtOhj4RH/ cuo5b3iAV8zbb9ZC8ule0oWaHl1I0k6pAE8DO39amOoW2nWo30n+LCuMkpfFpbOMpx V034iq4+YSLx2RRTcNly/l3eM7CodL+2w10qUdQo= Message-ID: <38f6e4e7-b03c-4775-a02e-e3fe0771122c@oktetlabs.ru> Date: Wed, 17 Jan 2024 10:52:40 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 5/5] eal: replace out of bounds VLA with static_assert Content-Language: en-US To: Stephen Hemminger , dev@dpdk.org Cc: =?UTF-8?Q?Morten_Br=C3=B8rup?= , Tyler Retzlaff References: <20231111172153.57461-1-stephen@networkplumber.org> <20240116184307.162882-1-stephen@networkplumber.org> <20240116184307.162882-6-stephen@networkplumber.org> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <20240116184307.162882-6-stephen@networkplumber.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 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(). > > 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. > > Signed-off-by: Stephen Hemminger > Acked-by: Morten Brørup > Acked-by: Tyler Retzlaff Acked-by: Andrew Rybchenko Does it imply any limitations on Gcc / Clang versions to be used? Is it documented somewhere in DPDK?