From: Thomas Monjalon <thomas@monjalon.net>
To: Eli Britstein <elibr@nvidia.com>
Cc: dev@dpdk.org, Ilya Maximets <i.maximets@ovn.org>,
Gaetan Rivet <gaetanr@nvidia.com>, Majd Dibbiny <majd@nvidia.com>,
Asaf Penso <asafp@nvidia.com>,
Harry Van Haaren <harry.van.haaren@intel.com>,
stable@dpdk.org, olivier.matz@6wind.com,
andrew.rybchenko@oktetlabs.ru
Subject: Re: [dpdk-dev] [PATCH 2/3] mbuf: avoid cast-align warning in pktmbuf mtod offset macro
Date: Tue, 13 Jul 2021 09:43:57 +0200 [thread overview]
Message-ID: <4929759.u37M3IBpAE@thomas> (raw)
In-Reply-To: <20210713064910.12793-3-elibr@nvidia.com>
+Cc mbuf maintainers
Please use --cc-cmd devtools/get-maintainer.sh to make it automatic.
13/07/2021 08:49, Eli Britstein:
> In rte_pktmbuf_mtod_offset macro, there is a casting from char * to type
> 't', which may cause cast-align warning when using gcc flags
> '-Werror -Wcast-align':
>
> .../include/rte_mbuf_core.h:723:3: error: cast increases required alignment
> of target type [-Werror=cast-align]
> 723 | ((t)((char *)(m)->buf_addr + (m)->data_off + (o)))
> | ^
>
> As the code assumes correct alignment, add first a (void *) casting, to
> avoid the warning.
>
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
>
> Signed-off-by: Eli Britstein <elibr@nvidia.com>
> ---
> lib/mbuf/rte_mbuf_core.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h
> index bb38d7f581..dabdeee604 100644
> --- a/lib/mbuf/rte_mbuf_core.h
> +++ b/lib/mbuf/rte_mbuf_core.h
> @@ -720,7 +720,7 @@ struct rte_mbuf_ext_shared_info {
> * The type to cast the result into.
> */
> #define rte_pktmbuf_mtod_offset(m, t, o) \
> - ((t)((char *)(m)->buf_addr + (m)->data_off + (o)))
> + ((t)(void *)((char *)(m)->buf_addr + (m)->data_off + (o)))
>
> /**
> * A macro that points to the start of the data in the mbuf.
>
next prev parent reply other threads:[~2021-07-13 7:44 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-13 6:49 [dpdk-dev] [PATCH 0/3] Avoid cast-align warnings Eli Britstein
2021-07-13 6:49 ` [dpdk-dev] [PATCH 1/3] net: avoid cast-align warning in VLAN insert function Eli Britstein
2021-07-30 10:57 ` Olivier Matz
2021-07-13 6:49 ` [dpdk-dev] [PATCH 2/3] mbuf: avoid cast-align warning in pktmbuf mtod offset macro Eli Britstein
2021-07-13 7:43 ` Thomas Monjalon [this message]
2021-07-28 15:28 ` Olivier Matz
2021-07-29 7:13 ` Eli Britstein
2021-07-30 11:10 ` Olivier Matz
2021-08-01 8:06 ` Eli Britstein
2021-10-19 6:41 ` Eli Britstein
2021-10-19 9:47 ` Olivier Matz
2021-07-13 6:49 ` [dpdk-dev] [PATCH 3/3] eal/x86: avoid cast-align warning in x86 memcpy functions Eli Britstein
2021-10-21 8:51 ` [dpdk-dev] [PATCH V2 1/3] net: avoid cast-align warning in VLAN insert function Eli Britstein
2021-10-21 8:51 ` [dpdk-dev] [PATCH V2 2/3] mbuf: avoid cast-align warning in pktmbuf mtod offset macro Eli Britstein
2021-10-21 8:51 ` [dpdk-dev] [PATCH V2 3/3] eal/x86: avoid cast-align warning in x86 memcpy functions Eli Britstein
2021-10-25 15:29 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2021-10-21 15:48 ` [dpdk-dev] [PATCH V2 1/3] net: avoid cast-align warning in VLAN insert function Stephen Hemminger
2021-10-21 16:16 ` Eli Britstein
2021-10-21 16:22 ` Stephen Hemminger
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=4929759.u37M3IBpAE@thomas \
--to=thomas@monjalon.net \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=asafp@nvidia.com \
--cc=dev@dpdk.org \
--cc=elibr@nvidia.com \
--cc=gaetanr@nvidia.com \
--cc=harry.van.haaren@intel.com \
--cc=i.maximets@ovn.org \
--cc=majd@nvidia.com \
--cc=olivier.matz@6wind.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 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).