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 5DAB64331C; Mon, 13 Nov 2023 17:28:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B03940A71; Mon, 13 Nov 2023 17:28:59 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 99D7A4026C for ; Mon, 13 Nov 2023 17:28:57 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 0024620B74C1; Mon, 13 Nov 2023 08:28:56 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0024620B74C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1699892937; bh=nvu9tBZgHGIC8UCFpsQkZmWS9tSvvsJRz0nai1aLNVc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eRR5etsVQJEp0pp/4r+8KfiqbE3f6DqCgQS00icS4YrXgY4UAbihEyqgyIVytt6/L N1UBRg33xczA9kFj6NOLBB7mUIXyc8ANF9m5WzfD87NNRR5nR5G1zdu3hrZb5sM0s2 XPQ+P75PyraBgfg3omdloqHxWnFdGw/BkLcBNSS8= Date: Mon, 13 Nov 2023 08:28:56 -0800 From: Tyler Retzlaff To: Stephen Hemminger Cc: dev@dpdk.org Subject: Re: [RFC] eal: use _Static_assert() for RTE_BUILD_BUG_ON Message-ID: <20231113162856.GB13153@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20231111172153.57461-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231111172153.57461-1-stephen@networkplumber.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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 Sat, Nov 11, 2023 at 09:21:53AM -0800, Stephen Hemminger wrote: > The method of doing sizeof a bad array element was an interesting > hack but it has a couple of problems. First, it won't work if > VLA checking is enabled. It doesn't enforce that the expression > is constant. > > Replace that with the _Static_assert builtin available in > Gcc, Clang, and MSVC. > > Signed-off-by: Stephen Hemminger > --- Acked-by: Tyler Retzlaff