summaryrefslogtreecommitdiffstats
path: root/sys/conf/kern.mk
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2013-05-15 13:04:10 +0000
committerbrooks <brooks@FreeBSD.org>2013-05-15 13:04:10 +0000
commit4d008876be6c5f3ff3209a2b07c125927b15e2bd (patch)
treea858bcd67e9175cf2a521df24b730c30ed84d560 /sys/conf/kern.mk
parent0a904132b441e7ca952cd7d21049ed15259c7177 (diff)
downloadFreeBSD-src-4d008876be6c5f3ff3209a2b07c125927b15e2bd.zip
FreeBSD-src-4d008876be6c5f3ff3209a2b07c125927b15e2bd.tar.gz
Add a new option WITHOUT_FORMAT_EXTENSIONS to disable flags related to
checking our kernel printf extensions. This is useful to allow compilers without these extensions to build kernels. Sponsored by: DARPA, AFRL
Diffstat (limited to 'sys/conf/kern.mk')
-rw-r--r--sys/conf/kern.mk12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index e42b753..99211f0 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -5,7 +5,7 @@
#
CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
- -Wundef -Wno-pointer-sign -fformat-extensions \
+ -Wundef -Wno-pointer-sign ${FORMAT_EXTENTIONS} \
-Wmissing-include-dirs -fdiagnostics-show-option \
${CWARNEXTRA}
#
@@ -29,7 +29,15 @@ NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized
# enough to error out the whole kernel build. Display them anyway, so there is
# some incentive to fix them eventually.
CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \
- -Wno-error-parentheses-equality
+ -Wno-error-parentheses-equality ${NO_WFORMAT}
+.endif
+
+# 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"
+NO_WFORMAT= -Wno-format
+.else
+FORMAT_EXTENTIONS= -fformat-extensions
.endif
#
OpenPOWER on IntegriCloud