From 78da3f724c7ee2210a8735c60ea520ed7554f3f9 Mon Sep 17 00:00:00 2001 From: zrj Date: Wed, 2 May 2018 18:34:06 +0300 Subject: [PATCH] bsd.sys.mk: Add handling for gcc80. * Turn off -Wformat-* family of warnings, the -Wformat-truncation and -Wformat-overflow is just too noisy for not much benefit. Do the same for -Wstringop-* family for now. Move these warnings (at their default settings) to WARNS_AUDIT. * Disable -Wimplicit-fallthough at WARNS=3, most of contrib is there. --- share/mk/bsd.sys.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 3d5032cdda..cf0053fb95 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -65,6 +65,14 @@ _cnowarnflags += -Wno-maybe-uninitialized _cnowarnflags += -Wno-uninitialized . endif . endif +# Delete -Wformat-* family that give little benefits, same for stringop. +. if ${WARNS} >= 2 && ${WARNS} <= 6 && ${_WCCVER:Mgcc8*} +_cnowarnflags += -Wno-format-overflow -Wno-format-truncation +_cnowarnflags += -Wno-stringop-truncation +. endif +. if ${WARNS} >= 1 && ${WARNS} <= 6 && ${_WCCVER:Mgcc8*} +_cnowarnflags += -Wno-stringop-overflow +. endif # Activate gcc47's -Wunused-but-set-variable (which is in -Wall) and # -Wunused-but-set-parameter (which is in -Wextra) only at WARNS >= 4 # (which is the level when also -Wunused-parameter comes into play). @@ -77,6 +85,9 @@ _cnowarnflags += -Wno-unused-but-set-parameter . if ${WARNS} == 3 && (${_WCCVER:Mgcc49} || ${_WCCVER:Mgcc[5-]*}) _cnowarnflags += -Wno-unused-value . endif +. if ${WARNS} == 3 && ${_WCCVER:Mgcc8*} +_cnowarnflags += -Wno-implicit-fallthrough +. endif . if ${WARNS} >= 2 && ${_WCCVER:Mgcc4[789]} _cnowarnflags += -Wno-error=maybe-uninitialized\ -Wno-error=uninitialized\ -- 2.11.4.GIT