Deleted Added
full compact
kern.mk (276666) kern.mk (276696)
1# $FreeBSD: head/sys/conf/kern.mk 276666 2015-01-04 20:08:24Z ian $
1# $FreeBSD: head/sys/conf/kern.mk 276696 2015-01-05 12:28:22Z 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 \

--- 14 unchanged lines hidden (view full) ---

24NO_WUNNEEDED_INTERNAL_DECL= -Wno-unneeded-internal-declaration
25NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized
26# Several other warnings which might be useful in some cases, but not severe
27# enough to error out the whole kernel build. Display them anyway, so there is
28# some incentive to fix them eventually.
29CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \
30 -Wno-error-parentheses-equality -Wno-error-unused-function \
31 -Wno-error-pointer-sign -Wno-error-format -Wno-error-parentheses
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 \

--- 14 unchanged lines hidden (view full) ---

24NO_WUNNEEDED_INTERNAL_DECL= -Wno-unneeded-internal-declaration
25NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized
26# Several other warnings which might be useful in some cases, but not severe
27# enough to error out the whole kernel build. Display them anyway, so there is
28# some incentive to fix them eventually.
29CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \
30 -Wno-error-parentheses-equality -Wno-error-unused-function \
31 -Wno-error-pointer-sign -Wno-error-format -Wno-error-parentheses
32
33CLANG_NO_IAS= -no-integrated-as
34.if ${COMPILER_VERSION} < 30500
35# XXX: clang < 3.5 integrated-as doesn't grok .codeNN directives
36CLANG_NO_IAS34= -no-integrated-as
32.endif
37.endif
38.endif
33
34.if ${COMPILER_TYPE} == "gcc"
39
40.if ${COMPILER_TYPE} == "gcc"
41GCC_MS_EXTENSIONS= -fms-extensions
35.if ${COMPILER_VERSION} >= 40300
36# Catch-all for all the things that are in our tree, but for which we're
37# not yet ready for this compiler. Note: we likely only really "support"
38# building with gcc 4.8 and newer. Nothing older has been tested.
39CWARNEXTRA?= -Wno-error=inline -Wno-error=enum-compare -Wno-error=unused-but-set-variable \
40 -Wno-error=aggressive-loop-optimizations -Wno-error=maybe-uninitialized \
41 -Wno-error=array-bounds -Wno-error=address \
42 -Wno-error=cast-qual -Wno-error=sequence-point -Wno-error=attributes \

--- 120 unchanged lines hidden (view full) ---

163# cope well with DWARF 4, so force it to genereate DWARF2, which they
164# understand. Do this unconditionally as it is harmless when not needed,
165# but critical for these newer versions.
166#
167.if ${CFLAGS:M-g} != "" && ${CFLAGS:M-gdwarf*} == ""
168CFLAGS+= -gdwarf-2
169.endif
170
42.if ${COMPILER_VERSION} >= 40300
43# Catch-all for all the things that are in our tree, but for which we're
44# not yet ready for this compiler. Note: we likely only really "support"
45# building with gcc 4.8 and newer. Nothing older has been tested.
46CWARNEXTRA?= -Wno-error=inline -Wno-error=enum-compare -Wno-error=unused-but-set-variable \
47 -Wno-error=aggressive-loop-optimizations -Wno-error=maybe-uninitialized \
48 -Wno-error=array-bounds -Wno-error=address \
49 -Wno-error=cast-qual -Wno-error=sequence-point -Wno-error=attributes \

--- 120 unchanged lines hidden (view full) ---

170# cope well with DWARF 4, so force it to genereate DWARF2, which they
171# understand. Do this unconditionally as it is harmless when not needed,
172# but critical for these newer versions.
173#
174.if ${CFLAGS:M-g} != "" && ${CFLAGS:M-gdwarf*} == ""
175CFLAGS+= -gdwarf-2
176.endif
177
171CFLAGS+= ${CWARNEXTRA}
178CFLAGS+= ${CWARNEXTRA} ${CWARNFLAGS} ${CWARNFLAGS.${.IMPSRC:T}}
179CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} ${CFLAGS.${.IMPSRC}}
172
180
173CFLAGS+= ${CFLAGS.${COMPILER_TYPE}}
174
175# Tell bmake not to mistake standard targets for things to be searched for
176# or expect to ever be up-to-date.
177PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \
178 beforelinking build build-tools buildfiles buildincludes \
179 checkdpadd clean cleandepend cleandir cleanobj configure \
180 depend dependall distclean distribute exe \
181 html includes install installfiles installincludes lint \
182 obj objlink objs objwarn realall realdepend \

--- 11 unchanged lines hidden (view full) ---

194CFLAGS+= -std=iso9899:1990
195.elif ${CSTD} == "c94" || ${CSTD} == "c95"
196CFLAGS+= -std=iso9899:199409
197.elif ${CSTD} == "c99"
198CFLAGS+= -std=iso9899:1999
199.else # CSTD
200CFLAGS+= -std=${CSTD}
201.endif # CSTD
181# Tell bmake not to mistake standard targets for things to be searched for
182# or expect to ever be up-to-date.
183PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \
184 beforelinking build build-tools buildfiles buildincludes \
185 checkdpadd clean cleandepend cleandir cleanobj configure \
186 depend dependall distclean distribute exe \
187 html includes install installfiles installincludes lint \
188 obj objlink objs objwarn realall realdepend \

--- 11 unchanged lines hidden (view full) ---

200CFLAGS+= -std=iso9899:1990
201.elif ${CSTD} == "c94" || ${CSTD} == "c95"
202CFLAGS+= -std=iso9899:199409
203.elif ${CSTD} == "c99"
204CFLAGS+= -std=iso9899:1999
205.else # CSTD
206CFLAGS+= -std=${CSTD}
207.endif # CSTD
202
203# Pull in any CWARNFLAGS the modules have added.
204CFLAGS+= ${CWARNFLAGS} ${CWARNFLAGS.${.IMPSRC:T}}