From 4d008876be6c5f3ff3209a2b07c125927b15e2bd Mon Sep 17 00:00:00 2001 From: brooks Date: Wed, 15 May 2013 13:04:10 +0000 Subject: 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 --- sys/conf/kern.mk | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'sys/conf/kern.mk') 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 # -- cgit v1.1