Date: Thu, 1 Jan 2015 08:18:09 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r276496 - head/sys/conf Message-ID: <201501010818.t018I9Mh081859@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Thu Jan 1 08:18:08 2015 New Revision: 276496 URL: https://svnweb.freebsd.org/changeset/base/276496 Log: Move more of the warnings into kern.mk, as well as centralize that as the place where the C dialect is selected. Have a fairly long list of newly requires warning suppression for clang 3.5.0, also centralized in kern.mk. Survive the fallout of the removal of bsd.sys.mk from bsd.kmod.mk. Modified: head/sys/conf/kern.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Thu Jan 1 06:53:33 2015 (r276495) +++ head/sys/conf/kern.mk Thu Jan 1 08:18:08 2015 (r276496) @@ -29,7 +29,12 @@ NO_WSOMETIMES_UNINITIALIZED= -Wno-error- # 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-unused-function + -Wno-error-parentheses-equality -Wno-error-unused-function \ + -Wno-error-pointer-sign -Wno-error-format -Wno-error-parentheses \ + -Wno-error-switch -Wno-error-switch \ + -Wno-error-shift-count-negative \ + -Wno-error-shift-count-overflow \ + -Wno-error-constant-conversion .endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40300 @@ -164,13 +169,7 @@ CFLAGS+= -fstack-protector CFLAGS+= -gdwarf-2 .endif -# A whole bunch of new default warnings in clang 3.5 subpress for now until -# this can be cleaned up. -.if ${COMPILER_VERSION} >= 30500 -CFLAGS.clang+= -Wno-pointer-sign -Wno-constant-conversion -Wno-format \ - -Wno-shift-count-negative -Wno-tautological-pointer-compare \ - -Wno-shift-count-overflow -Wno-tautological-compare -.endif +CFLAGS+= ${CWARNEXTRA} CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} @@ -187,3 +186,17 @@ PHONY_NOTMAIN = afterdepend afterinstall .PHONY: ${PHONY_NOTMAIN} .NOTMAIN: ${PHONY_NOTMAIN} + +CSTD= c99 + +.if ${CSTD} == "k&r" +CFLAGS+= -traditional +.elif ${CSTD} == "c89" || ${CSTD} == "c90" +CFLAGS+= -std=iso9899:1990 +.elif ${CSTD} == "c94" || ${CSTD} == "c95" +CFLAGS+= -std=iso9899:199409 +.elif ${CSTD} == "c99" +CFLAGS+= -std=iso9899:1999 +.else # CSTD +CFLAGS+= -std=${CSTD} +.endif # CSTD Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu Jan 1 06:53:33 2015 (r276495) +++ head/sys/conf/kern.pre.mk Thu Jan 1 08:18:08 2015 (r276496) @@ -60,7 +60,6 @@ COPTFLAGS+= -fno-strict-aliasing .if !defined(NO_CPU_COPTFLAGS) COPTFLAGS+= ${_CPUCFLAGS} .endif -C_DIALECT= -std=c99 NOSTDINC= -nostdinc INCLUDES= ${NOSTDINC} ${INCLMAGIC} -I. -I$S @@ -88,7 +87,7 @@ INCLUDES+= -I$S/dev/cxgb -I$S/dev/cxgbe .endif -CFLAGS= ${COPTFLAGS} ${C_DIALECT} ${DEBUG} ${CWARNFLAGS} +CFLAGS= ${COPTFLAGS} ${DEBUG} ${CWARNFLAGS} CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100 CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000 Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Thu Jan 1 06:53:33 2015 (r276495) +++ head/sys/conf/kmod.mk Thu Jan 1 08:18:08 2015 (r276496) @@ -89,7 +89,6 @@ CFLAGS+= -D_KERNEL CFLAGS+= -DKLD_MODULE # Don't use any standard or source-relative include directories. -CSTD= c99 NOSTDINC= -nostdinc CFLAGS:= ${CFLAGS:N-I*} ${NOSTDINC} ${INCLMAGIC} ${CFLAGS:M-I*} .if defined(KERNBUILDDIR)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501010818.t018I9Mh081859>