25/09/2024 17:47, Stephen Hemminger: > On Wed, 25 Sep 2024 11:40:54 -0400 > Robin Jarry <rja...@redhat.com> wrote: > > > From: Robin Jarry <rja...@redhat.com> > > To: dev@dpdk.org > > Subject: [PATCH dpdk v2] mbuf: fix strict aliasing error in allocator > > Date: Wed, 25 Sep 2024 11:40:54 -0400 > > > > When building an application with -fstrict-aliasing -Wstrict-aliasing=2, > > we get errors triggered by rte_mbuf_raw_alloc() which is called inline > > from rte_pktmbuf_alloc(). > > > > ../dpdk/lib/mbuf/rte_mbuf.h: In function ‘rte_mbuf_raw_alloc’: > > ../dpdk/lib/mbuf/rte_mbuf.h:600:42: error: dereferencing type-punned > > pointer might break strict-aliasing rules [-Werror=strict-aliasing] > > 600 | if (rte_mempool_get(mp, (void **)&m) < 0) > > | ^~ > > > > Avoid incorrect casting by using an inline union variable. > > > > Signed-off-by: Robin Jarry <rja...@redhat.com> > > Thanks, union is safer than cast. > > Reviewed-by: Stephen Hemminger <step...@networkplumber.org>
Applied, thanks.