summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Libby <rlibby@FreeBSD.org>2020-12-18 08:40:33 +0000
committerRyan Libby <rlibby@FreeBSD.org>2020-12-18 08:40:33 +0000
commitbb4629fa497f2deaa7eb62f84b67262e852a60ff (patch)
tree5d217509937d473ecf60e46c0642598db239aab5
parent12fc18b805376002ff195f2f4edebf179edd2a9c (diff)
downloadsrc-test2-bb4629fa497f2deaa7eb62f84b67262e852a60ff.tar.gz
src-test2-bb4629fa497f2deaa7eb62f84b67262e852a60ff.zip
MFC r350739-r350740 (by cem)
r350739: 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. r350740: r350739 try #2 For some inexplicable reason, C++ compilers reject the -Wno- flag, and also (ab)use CWARNFLAGS. Reported by: imp
Notes
Notes: svn path=/stable/12/; revision=368753
-rw-r--r--share/mk/bsd.sys.mk3
-rw-r--r--sys/conf/kern.mk3
2 files changed, 6 insertions, 0 deletions
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 6ff899b30d45..61da8f31cb0f 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -201,6 +201,9 @@ FORMAT_EXTENSIONS= -fformat-extensions
CWARNFLAGS+= -Wno-unknown-pragmas
.endif # IGNORE_PRAGMA
+# This warning is utter nonsense
+CFLAGS+= -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 3802f3211fdf..fd9aadb58945 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -86,6 +86,9 @@ NO_WCAST_QUAL= -Wno-cast-qual
.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"