From: Krzysztof Kanas <kka...@marvell.com>

gcc prior 9 don't will add additional warning for unrecognized command
line option, but only when there is some other warning in the code, e.g
unused variable.

Fixes: a385972c3675 ("mk: disable warning for packed member pointer")
Cc: reshma.pat...@intel.com

Signed-off-by: Krzysztof Kanas <kka...@marvell.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 b852fcfd7e24..1bd384f7ca3f 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -88,7 +88,9 @@ WERROR_FLAGS += -Wno-format-truncation
 endif
 
 # disable packed member unalign warnings
+ifeq ($(shell test $(HOST_GCC_VERSION) -gt 90 && echo 1), 1)
 WERROR_FLAGS += -Wno-address-of-packed-member
+endif
 
 export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
 export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
-- 
2.21.0

Reply via email to