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 5436C4331D; Mon, 13 Nov 2023 19:57:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A020402AB; Mon, 13 Nov 2023 19:57:59 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id D08C24026F for ; Mon, 13 Nov 2023 19:57:57 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 28E4520B74C1; Mon, 13 Nov 2023 10:57:57 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 28E4520B74C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1699901877; bh=PSKf55EA+gVP+5dkmdT9fxAQGFLPEMInbcEzPa/46CM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YaY55D3awOGhCNCmp8W3oa984anSRWtwv2YjgY8B6ZXlsf4b/1pE0hA9W8FAGrGMJ 1+urZLX3oS8ofDTjQs/lXt9AR6V3fcftNmIu9nG8vQiuM5y++4WoAeKmMnQbpxPc0F bHRCdPcsrnLlPnzgfeAT0Oah3AahecKvJe/2nER0= Date: Mon, 13 Nov 2023 10:57:57 -0800 From: Tyler Retzlaff To: Ferruh Yigit Cc: Stephen Hemminger , dev@dpdk.org Subject: Re: [PATCH v2 0/3] use static_assertion for build errors Message-ID: <20231113185757.GA9022@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20231111172153.57461-1-stephen@networkplumber.org> <20231113170605.408281-1-stephen@networkplumber.org> <1c7d9add-1d1f-4f7a-9b12-977897913ca7@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1c7d9add-1d1f-4f7a-9b12-977897913ca7@amd.com> 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 Mon, Nov 13, 2023 at 06:13:30PM +0000, Ferruh Yigit wrote: > On 11/13/2023 5:06 PM, Stephen Hemminger wrote: > > This series fixes a couple places where expressions that could not > > be evaluated as constant early in compiler passes were used. And then > > converts RTE_BUILD_BUG_ON() with static_assert. > > > > Stephen Hemminger (3): > > event/opdl: fix non-constant compile time assertion > > net/sfc: fix non-constant expression inr RTE_BUILD_BUG_ON() > > eal: replace out of bounds VLA with static_assert > > > > Acked-by: Ferruh Yigit > > > I am getting more build errors [1], [2]. > > > > [1] `meson --buildtype=debug build` > > In file included from ../lib/eal/include/dev_driver.h:12, > from ../lib/ethdev/ethdev_driver.h:23, > from ../drivers/net/i40e/i40e_rxtx_vec_sse.c:6: > ../drivers/net/i40e/i40e_rxtx_vec_sse.c: In function ‘descs_to_fdir_32b’: > ../lib/eal/include/rte_common.h:499:51: error: expression in static > assertion is not constant > 499 | #define RTE_BUILD_BUG_ON(condition) static_assert(!(condition), > #condition) > | ^~~~~~~~~~~~ > ../drivers/net/i40e/i40e_rxtx_vec_sse.c:147:9: note: in expansion of > macro ‘RTE_BUILD_BUG_ON’ > 147 | RTE_BUILD_BUG_ON(RTE_MBUF_F_RX_FDIR_ID != (1 << > FDIR_ID_BIT_SHIFT)); this one is fixable by just making it a constant expression instead of a const variable. - i40e_rxtx_vec_sse.c: const uint32_t FDIR_ID_BIT_SHIFT = 13; + i40e_rxtx_vec_sse.c: #define FDIR_ID_BIT_SHIFT (13u) ... whatever ... + i40e_rxtx_vec_sse.c: #undef FDIR_ID_BIT_SHIFT ty