[dpdk-stable] [PATCH 17.11] mk: disable warnings for packed mem config data structure

Bruce Richardson bruce.richardson at intel.com
Mon Sep 2 16:42:39 CEST 2019


The rte_mem_config data structure is marked as packed, but we access
members of that structure via pointers in the code. This leads to warnings
with later gcc compilers e.g. gcc9, so disable those warnings to allow
clean builds.

For older GCC versions, which may not have the flag, there is no need to
filter it out as adding unrecognised warning disable flags to GCC is always
safe [Ref: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html]

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
 mk/toolchain/gcc/rte.vars.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
index e7008c052..ec082db99 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -81,6 +81,8 @@ ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror
 endif
 
+WERROR_FLAGS += -Wno-address-of-packed-member
+
 # There are many issues reported for strict alignment architectures
 # which are not necessarily fatal. Report as warnings.
 ifeq ($(CONFIG_RTE_ARCH_STRICT_ALIGN),y)
-- 
2.21.0



More information about the stable mailing list