numam-dpdk/lib/mbuf
Eli Britstein da0333c879 mbuf: avoid cast-align warning in data offset macro
In rte_pktmbuf_mtod_offset macro, there is a casting from char * to type
't', which may cause cast-align warning when using strict cast align
flag with supporting gcc:
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
CFLAGS="-Wcast-align=strict" make V=1 -C examples/l2fwd clean static

main.c: In function 'l2fwd_mac_updating':
/dpdk/build/include/rte_mbuf_core.h:719:3: warning: cast increases
required alignment of target type [-Wcast-align]
  719 |  ((t)((char *)(m)->buf_addr + (m)->data_off + (o)))
      |   ^
/dpdk/build/include/rte_mbuf_core.h:733:32: note: in expansion of macro
'rte_pktmbuf_mtod_offset'
  733 | #define rte_pktmbuf_mtod(m, t) rte_pktmbuf_mtod_offset(m, t, 0)
      |                                ^~~~~~~~~~~~~~~~~~~~~~~

As the code assumes correct alignment, add first a (void *) casting, to
avoid the warning.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Eli Britstein <elibr@nvidia.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2021-10-25 17:27:48 +02:00
..
meson.build build: fix formatting of Meson lists 2021-05-04 15:01:47 +02:00
rte_mbuf_core.h mbuf: avoid cast-align warning in data offset macro 2021-10-25 17:27:48 +02:00
rte_mbuf_dyn.c mbuf: add namespace to offload flags 2021-10-24 13:37:43 +02:00
rte_mbuf_dyn.h ethdev: add namespace 2021-10-22 18:15:38 +02:00
rte_mbuf_pool_ops.c lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_mbuf_pool_ops.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_mbuf_ptype.c lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_mbuf_ptype.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_mbuf.c mbuf: add namespace to offload flags 2021-10-24 13:37:43 +02:00
rte_mbuf.h mbuf: add namespace to offload flags 2021-10-24 13:37:43 +02:00
version.map mbuf: promote check helper to stable 2021-10-05 11:04:03 +02:00