All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Amit Prakash Shukla <amitprakashs@marvell.com>
Cc: Yuying Zhang <Yuying.Zhang@intel.com>,
	Beilei Xing <beilei.xing@intel.com>,
	stable@dpdk.org, dev@dpdk.org, jerinj@marvell.com,
	stable@dpdk.org
Subject: Re: [PATCH 1/2] net/i40e: compilation fix for GCC-12
Date: Thu, 06 Oct 2022 11:51:15 +0200	[thread overview]
Message-ID: <1833207.CQOukoFCf9@thomas> (raw)
In-Reply-To: <20220824140339.2581716-1-amitprakashs@marvell.com>

24/08/2022 16:03, Amit Prakash Shukla:
> GCC 12 raises the following warning:
> 
> meson --werror --buildtype=debugoptimized
> 	--cross-file config/x86/cross-mingw -Dexamples=helloworld build
> ninja -C build
> 
> In function 'i40e_hash_get_pattern_type',
>     inlined from 'i40e_hash_get_pattern_pctypes' at
> ../drivers/net/i40e/i40e_hash.c:520:8,
>     inlined from 'i40e_hash_parse_pattern_act' at
> ../drivers/net/i40e/i40e_hash.c:1147:9,
>     inlined from 'i40e_hash_parse' at
> ../drivers/net/i40e/i40e_hash.c:1181:9:
> ../drivers/net/i40e/i40e_hash.c:389:47:
> 	error: array subscript 53 is above array
> 	bounds of 'const uint64_t[53]'
> 	{aka 'const long long unsigned int[53]'} [-Werror=array-bounds]
>   389 |                 item_hdr = pattern_item_header[last_item_type];
>       |                            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
> ../drivers/net/i40e/i40e_hash.c: In function 'i40e_hash_parse':
> ../drivers/net/i40e/i40e_hash.c:182:23: note: while referencing
> 'pattern_item_header'
>   182 | static const uint64_t pattern_item_header[] = {
>       |                       ^~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> 
> Fixes: ef4c16fd9148 (net/i40e: refactor RSS flow)
> Cc: stable@dpdk.org
> 
> Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>

Sorry I did not notice this patch and I recently submitted one
which I will abandon.
It seems there was no reply from i40e maintainers after 6 weeks,
but I will apply anyway.

I will use my commit message:

    net/i40e: fix build with MinGW GCC 12
    
    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 real check is added to make the compiler happy.
    
    Fixes: ef4c16fd9148 ("net/i40e: refactor RSS flow")
    Cc: stable@dpdk.org




      parent reply	other threads:[~2022-10-06  9:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23 10:57 [PATCH 1/3] net/i40e: compilation fix for GCC-12 Amit Prakash Shukla
2022-08-23 10:57 ` [PATCH 2/3] net/qede/base: " Amit Prakash Shukla
2022-08-23 10:57 ` [PATCH 3/3] examples/ipsec-secgw: " Amit Prakash Shukla
2022-08-23 13:12   ` Akhil Goyal
2022-08-24 14:03 ` [PATCH 1/2] net/i40e: " Amit Prakash Shukla
2022-08-24 14:03   ` [PATCH 2/2] net/qede/base: " Amit Prakash Shukla
2022-10-06  9:52     ` Thomas Monjalon
2022-08-25  7:21   ` [PATCH 1/2] net/i40e: " Morten Brørup
2022-08-26  9:45   ` Amit Prakash Shukla
2022-08-26 10:32     ` Morten Brørup
2022-10-06  9:51   ` Thomas Monjalon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1833207.CQOukoFCf9@thomas \
    --to=thomas@monjalon.net \
    --cc=Yuying.Zhang@intel.com \
    --cc=amitprakashs@marvell.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.