From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Ferruh Yigit <ferruh.yigit@amd.com>,
"NBU-Contact-Thomas Monjalon (EXTERNAL)" <thomas@monjalon.net>,
Ori Kam <orika@nvidia.com>,
Aman Singh <aman.deep.singh@intel.com>,
Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,
Reshma Pattan <reshma.pattan@intel.com>,
Stephen Hemminger <stephen@networkplumber.org>,
Akhil Goyal <gakhil@marvell.com>,
Anoob Joseph <anoobj@marvell.com>,
Potnuri Bharat Teja <bharat@chelsio.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>,
Sachin Saxena <sachin.saxena@nxp.com>,
Matan Azrad <matan@nvidia.com>,
Slava Ovsiienko <viacheslavo@nvidia.com>,
Bing Zhao <bingz@nvidia.com>, Suanming Mou <suanmingm@nvidia.com>,
Chaoyong He <chaoyong.he@corigine.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"Morten Brørup" <mb@smartsharesystems.com>,
"Bruce Richardson" <bruce.richardson@intel.com>
Subject: RE: [PATCH] ethdev: convert string initialization
Date: Fri, 4 Oct 2024 19:18:10 +0000 [thread overview]
Message-ID: <CH3PR12MB846075856C007F2C7F81BD3BA4722@CH3PR12MB8460.namprd12.prod.outlook.com> (raw)
In-Reply-To: <42a126ab-6162-4f9e-b547-4e9a36e723b2@oktetlabs.ru>
> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Sent: Friday, October 4, 2024 09:27
> To: Ferruh Yigit <ferruh.yigit@amd.com>; NBU-Contact-Thomas Monjalon
> (EXTERNAL) <thomas@monjalon.net>; Ori Kam <orika@nvidia.com>; Aman Singh
> <aman.deep.singh@intel.com>; Konstantin Ananyev
> <konstantin.v.ananyev@yandex.ru>; Reshma Pattan <reshma.pattan@intel.com>;
> Stephen Hemminger <stephen@networkplumber.org>; Akhil Goyal
> <gakhil@marvell.com>; Anoob Joseph <anoobj@marvell.com>; Potnuri Bharat
> Teja <bharat@chelsio.com>; Hemant Agrawal <hemant.agrawal@nxp.com>;
> Sachin Saxena <sachin.saxena@nxp.com>; Matan Azrad <matan@nvidia.com>;
> Slava Ovsiienko <viacheslavo@nvidia.com>; Dariusz Sosnowski
> <dsosnowski@nvidia.com>; Bing Zhao <bingz@nvidia.com>; Suanming Mou
> <suanmingm@nvidia.com>; Chaoyong He <chaoyong.he@corigine.com>
> Cc: dev@dpdk.org; Morten Brørup <mb@smartsharesystems.com>; Bruce
> Richardson <bruce.richardson@intel.com>
> Subject: Re: [PATCH] ethdev: convert string initialization
>
> External email: Use caution opening links or attachments
>
>
> On 10/4/24 07:13, Ferruh Yigit wrote:
> > gcc 15 experimental [1], with -Wextra flag, gives warning in variable
> > initialization as string [2].
> >
> > The warning has a point when initialized variable is intended to use
> > as string, since assignment is missing the required null terminator
> > for this case. But warning is useless for our usecase.
> >
> > In this patch only updated a few instance to show the issue, there are
> > many instances to fix, if we prefer to go this way.
> > Other option is to disable warning but it can be useful for actual
> > string usecases, so I prefer to keep it.
> >
> > Converted string initialization to array initialization.
> >
> > [1]
> > gcc (GCC) 15.0.0 20241003 (experimental)
> >
> > [2]
> > ../lib/ethdev/rte_flow.h:906:36:
> > error: initializer-string for array of ‘unsigned char’ is too long
> > [-Werror=unterminated-string-initialization]
> > 906 | .hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > ../lib/ethdev/rte_flow.h:907:36:
> > error: initializer-string for array of ‘unsigned char’ is too long
> > [-Werror=unterminated-string-initialization]
> > 907 | .hdr.src_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > ../lib/ethdev/rte_flow.h:1009:25:
> > error: initializer-string for array of ‘unsigned char’ is too long
> > [-Werror=unterminated-string-initialization]
> > 1009 | "\xff\xff\xff\xff\xff\xff\xff\xff"
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > ../lib/ethdev/rte_flow.h:1012:25:
> > error: initializer-string for array of ‘unsigned char’ is too long
> > [-Werror=unterminated-string-initialization]
> > 1012 | "\xff\xff\xff\xff\xff\xff\xff\xff"
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > ../lib/ethdev/rte_flow.h:1135:20:
> > error: initializer-string for array of ‘unsigned char’ is too long
> > [-Werror=unterminated-string-initialization]
> > 1135 | .hdr.vni = "\xff\xff\xff",
> > | ^~~~~~~~~~~~~~
> >
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> > Acked-by: Morten Brørup <mb@smartsharesystems.com>
> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
>
>
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Best regards,
Dariusz Sosnowski
next prev parent reply other threads:[~2024-10-04 19:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 9:27 [RFC] " Ferruh Yigit
2024-08-01 10:33 ` Bruce Richardson
2024-08-01 11:29 ` Morten Brørup
2024-08-01 12:43 ` Ferruh Yigit
2024-08-01 13:29 ` Morten Brørup
2024-08-06 5:54 ` Tyler Retzlaff
2024-10-04 4:13 ` [PATCH] " Ferruh Yigit
2024-10-04 7:26 ` Andrew Rybchenko
2024-10-04 19:18 ` Dariusz Sosnowski [this message]
2024-10-04 15:17 ` [RFC] " Stephen Hemminger
2024-10-04 17:58 ` Ferruh Yigit
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=CH3PR12MB846075856C007F2C7F81BD3BA4722@CH3PR12MB8460.namprd12.prod.outlook.com \
--to=dsosnowski@nvidia.com \
--cc=aman.deep.singh@intel.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=anoobj@marvell.com \
--cc=bharat@chelsio.com \
--cc=bingz@nvidia.com \
--cc=bruce.richardson@intel.com \
--cc=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=gakhil@marvell.com \
--cc=hemant.agrawal@nxp.com \
--cc=konstantin.v.ananyev@yandex.ru \
--cc=matan@nvidia.com \
--cc=mb@smartsharesystems.com \
--cc=orika@nvidia.com \
--cc=reshma.pattan@intel.com \
--cc=sachin.saxena@nxp.com \
--cc=stephen@networkplumber.org \
--cc=suanmingm@nvidia.com \
--cc=thomas@monjalon.net \
--cc=viacheslavo@nvidia.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).