kern.mk (276496) | kern.mk (276606) |
---|---|
1# $FreeBSD: head/sys/conf/kern.mk 276496 2015-01-01 08:18:08Z imp $ | 1# $FreeBSD: head/sys/conf/kern.mk 276606 2015-01-03 03:35:18Z imp $ |
2 3# 4# Warning flags for compiling the kernel and components of the kernel: 5# 6CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ 7 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ 8 -Wundef -Wno-pointer-sign ${FORMAT_EXTENSIONS} \ 9 -Wmissing-include-dirs -fdiagnostics-show-option \ 10 ${CWARNEXTRA} 11# 12# The following flags are next up for working on: 13# -Wextra 14 15# Disable a few warnings for clang, since there are several places in the 16# kernel where fixing them is more trouble than it is worth, or where there is 17# a false positive. 18.if ${COMPILER_TYPE} == "clang" 19NO_WCONSTANT_CONVERSION= -Wno-constant-conversion | 2 3# 4# Warning flags for compiling the kernel and components of the kernel: 5# 6CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ 7 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ 8 -Wundef -Wno-pointer-sign ${FORMAT_EXTENSIONS} \ 9 -Wmissing-include-dirs -fdiagnostics-show-option \ 10 ${CWARNEXTRA} 11# 12# The following flags are next up for working on: 13# -Wextra 14 15# Disable a few warnings for clang, since there are several places in the 16# kernel where fixing them is more trouble than it is worth, or where there is 17# a false positive. 18.if ${COMPILER_TYPE} == "clang" 19NO_WCONSTANT_CONVERSION= -Wno-constant-conversion |
20NO_WARRAY_BOUNDS= -Wno-array-bounds | |
21NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-count-negative 22NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow | 20NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-count-negative 21NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow |
23NO_WUNUSED_VALUE= -Wno-unused-value | |
24NO_WSELF_ASSIGN= -Wno-self-assign | 22NO_WSELF_ASSIGN= -Wno-self-assign |
25NO_WFORMAT_SECURITY= -Wno-format-security | |
26NO_WUNNEEDED_INTERNAL_DECL= -Wno-unneeded-internal-declaration 27NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized 28# Several other warnings which might be useful in some cases, but not severe 29# enough to error out the whole kernel build. Display them anyway, so there is 30# some incentive to fix them eventually. 31CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \ 32 -Wno-error-parentheses-equality -Wno-error-unused-function \ 33 -Wno-error-pointer-sign -Wno-error-format -Wno-error-parentheses \ | 23NO_WUNNEEDED_INTERNAL_DECL= -Wno-unneeded-internal-declaration 24NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized 25# Several other warnings which might be useful in some cases, but not severe 26# enough to error out the whole kernel build. Display them anyway, so there is 27# some incentive to fix them eventually. 28CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \ 29 -Wno-error-parentheses-equality -Wno-error-unused-function \ 30 -Wno-error-pointer-sign -Wno-error-format -Wno-error-parentheses \ |
34 -Wno-error-switch -Wno-error-switch \ 35 -Wno-error-shift-count-negative \ 36 -Wno-error-shift-count-overflow \ 37 -Wno-error-constant-conversion | 31 -Wno-unknown-pragmas |
38.endif 39 40.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40300 41# Catch-all for all the things that are in our tree, but for which we're 42# not yet ready for this compiler. Note: we likely only really "support" 43# building with gcc 4.8 and newer. Nothing older has been tested. 44CWARNEXTRA?= -Wno-error=inline -Wno-error=enum-compare -Wno-error=unused-but-set-variable \ 45 -Wno-error=aggressive-loop-optimizations -Wno-error=maybe-uninitialized \ --- 149 unchanged lines hidden (view full) --- 195CFLAGS+= -std=iso9899:1990 196.elif ${CSTD} == "c94" || ${CSTD} == "c95" 197CFLAGS+= -std=iso9899:199409 198.elif ${CSTD} == "c99" 199CFLAGS+= -std=iso9899:1999 200.else # CSTD 201CFLAGS+= -std=${CSTD} 202.endif # CSTD | 32.endif 33 34.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40300 35# Catch-all for all the things that are in our tree, but for which we're 36# not yet ready for this compiler. Note: we likely only really "support" 37# building with gcc 4.8 and newer. Nothing older has been tested. 38CWARNEXTRA?= -Wno-error=inline -Wno-error=enum-compare -Wno-error=unused-but-set-variable \ 39 -Wno-error=aggressive-loop-optimizations -Wno-error=maybe-uninitialized \ --- 149 unchanged lines hidden (view full) --- 189CFLAGS+= -std=iso9899:1990 190.elif ${CSTD} == "c94" || ${CSTD} == "c95" 191CFLAGS+= -std=iso9899:199409 192.elif ${CSTD} == "c99" 193CFLAGS+= -std=iso9899:1999 194.else # CSTD 195CFLAGS+= -std=${CSTD} 196.endif # CSTD |
197 198# Pull in any CWARNFLAGS the modules have added. 199CFLAGS+= ${CWARNFLAGS} ${CWARNFLAGS.${.IMPSRC:T}} |
|