]> git.droids-corp.org - dpdk.git/blobdiff - mk/toolchain/gcc/rte.vars.mk
mk: adjust gcc flags for new gcc 7 warnings
[dpdk.git] / mk / toolchain / gcc / rte.vars.mk
index 5caa60004c4e73ece2aa92cf682f7c055ea9d6e9..3834e00cff2666939cdde618b5bb11c817159905 100644 (file)
@@ -99,5 +99,12 @@ ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1)
 WERROR_FLAGS += -Wno-uninitialized
 endif
 
+ifeq ($(shell test $(GCC_VERSION) -gt 70 && echo 1), 1)
+# Tell GCC only to error for switch fallthroughs without a suitable comment
+WERROR_FLAGS += -Wimplicit-fallthrough=2
+# Ignore errors for snprintf truncation
+WERROR_FLAGS += -Wno-format-truncation
+endif
+
 export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
 export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS