From patchwork Tue Oct 4 11:17:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 117306 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F17F6A0543; Tue, 4 Oct 2022 13:18:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 93D4E40DFB; Tue, 4 Oct 2022 13:18:06 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 64DAC40DDC for ; Tue, 4 Oct 2022 13:18:05 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 6BDA25C00FF; Tue, 4 Oct 2022 07:18:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 04 Oct 2022 07:18:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm2; t=1664882281; x=1664968681; bh=FXRewv5nE7 wEcfLhsRGzrmh6LszIvqVpDbJdX9HXpHI=; b=GVlMI4S2CP/HeH1t9Mww5m7QZN zlDb73TwNJDgQzqgNWm3rNU1DA2YMyxtcdyu89/l9sD4r0PSXPmdTfIOU4XEjCHq FgF5ksfUiDJaiuhgW+oBzFm+H1Q5JabhiJHkNf2NaW32bJTJhdzmuMr0ziqg/Lje zqn3JQUYqSb1QiPiumUsqrcU5SE73wC1yIaLr9Zsgf1pg4dm2yrPiqmZNQkLJDuA TbmbV2+p8xLYdWp4rxqpNRiVv5XRCf5xYaS5m5kAXnZKTSQG0WVR7DX7+mt7HEx2 iwDSHW47dq/V48NIW4kWPGGAYmNrtp1O3hO1RNAnKZrfETxwA37R+/uo43dQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1664882281; x=1664968681; bh=FXRewv5nE7wEc fLhsRGzrmh6LszIvqVpDbJdX9HXpHI=; b=I6l+Y5DBZjfF+YJnTYyCbfbavyOm/ ZSHabepcOUlkZeQAVeOKk7/Zh0HyoTNdSDjG4HsDnZ92tTNEP9fENCeyuM+FEQIl zrHqdWe2dc+lrL+U9PozMi9piDw/SAsOCCin89LD+KeXl25sjTZj2rRer7kivDZ6 K814vTepFaJWZCo8PFPYXmTym89EsNeRlfMLQj5wj1chiKIUizcp/T/dQiVbtIE8 x72ovzRwH9LAfGKvsB1BXXKREmY8k5GurEIlXMIOOOryrJL8+/r9yBv9nkQCFMW3 KEsenmI8wkhKGL23pDWnsBPMmy33hlgLdNkH4QXXFQiQkPAvanMd+Sxuw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeiuddgfeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofggtgfgsehtkeertdertdejnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhephfduueeffedvjeevhfekgeehleevjedvffdufeekudelfeehkeel heeiheffiedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 Oct 2022 07:18:00 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Yuying Zhang , Beilei Xing Subject: [PATCH] net/i40e: fix build with MinGW GCC 12 Date: Tue, 4 Oct 2022 13:17:42 +0200 Message-Id: <20221004111742.1497105-1-thomas@monjalon.net> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 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 When compiling with MinGW GCC 12, the rte_flow_item array is seen as read out of bound: net/i40e/i40e_hash.c:389:47: error: array subscript 50 is above array bounds of ‘const uint64_t[50]’ {aka ‘const long long unsigned int[50]’} [-Werror=array-bounds] 389 | item_hdr = pattern_item_header[last_item_type]; | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ It seems the assert check done above this line has no impact. A check is added to make the compiler happy. Signed-off-by: Thomas Monjalon --- drivers/net/i40e/i40e_hash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/i40e/i40e_hash.c b/drivers/net/i40e/i40e_hash.c index 8962e9d97a..ba616aea9f 100644 --- a/drivers/net/i40e/i40e_hash.c +++ b/drivers/net/i40e/i40e_hash.c @@ -386,6 +386,8 @@ i40e_hash_get_pattern_type(const struct rte_flow_item pattern[], prev_item_type = last_item_type; assert(last_item_type < (enum rte_flow_item_type) RTE_DIM(pattern_item_header)); + if (last_item_type >= RTE_DIM(pattern_item_header)) + goto not_sup; item_hdr = pattern_item_header[last_item_type]; assert(item_hdr);