From be3ab1876e1bb43e1e4a8dc4a29ce979c256cd06 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Thu, 8 Aug 2019 03:27:46 +0000 Subject: [PATCH] Disable useless -Wformat-zero-length It is part of -Wformat, which is enabled by -Wall. Empty format strings are well defined and it is perfectly reasonable to expect them in a formatting interface. --- share/mk/bsd.sys.mk | 3 +++ sys/conf/kern.mk | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 8c7c43f0609..ea755d61992 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -186,6 +186,9 @@ FORMAT_EXTENSIONS= -fformat-extensions CWARNFLAGS+= -Wno-unknown-pragmas .endif # IGNORE_PRAGMA +# This warning is utter nonsense +CWARNFLAGS+= -Wno-format-zero-length + # We need this conditional because many places that use it # only enable it for some files with CLFAGS.$FILE+=${CLANG_NO_IAS}. # unconditionally, and can't easily use the CFLAGS.clang= diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index a8cf270ed13..337970e49d5 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -61,8 +61,7 @@ CWARNEXTRA?= -Wno-error=address \ CWARNEXTRA+= -Wno-error=misleading-indentation \ -Wno-error=nonnull-compare \ -Wno-error=shift-overflow \ - -Wno-error=tautological-compare \ - -Wno-format-zero-length + -Wno-error=tautological-compare .endif .if ${COMPILER_VERSION} >= 70200 CWARNEXTRA+= -Wno-error=memset-elt-size @@ -80,6 +79,9 @@ NO_WNONNULL= -Wno-nonnull .endif .endif +# This warning is utter nonsense +CWARNFLAGS+= -Wno-format-zero-length + # External compilers may not support our format extensions. Allow them # to be disabled. WARNING: format checking is disabled in this case. .if ${MK_FORMAT_EXTENSIONS} == "no" -- 2.45.0