diff options
author | ian <ian@FreeBSD.org> | 2015-01-04 20:08:24 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2015-01-04 20:08:24 +0000 |
commit | 565507a6366963330d648a893a7a2380a2452fd6 (patch) | |
tree | cb6ca78dcf29ab1054435c822941b050015f51a4 | |
parent | 7646916ff089c355a68002d03e370cbee7257a36 (diff) | |
download | FreeBSD-src-565507a6366963330d648a893a7a2380a2452fd6.zip FreeBSD-src-565507a6366963330d648a893a7a2380a2452fd6.tar.gz |
Eliminate uninitialized variable warnings in kernel and module builds when
building with gcc 4.2
This has been requested several times over the past few months by several
people (including me), because gcc 4.2 just gets it wrong too often. It's
causing us to litter the code with lots of bogus initializers just to
squelch the warnings. We still have clang and coverity telling us about
uninitialized variables, and they do so more accurately.
-rw-r--r-- | sys/conf/kern.mk | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index c56f796..3cf3d94 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -31,7 +31,8 @@ CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \ -Wno-error-pointer-sign -Wno-error-format -Wno-error-parentheses .endif -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40300 +.if ${COMPILER_TYPE} == "gcc" +.if ${COMPILER_VERSION} >= 40300 # Catch-all for all the things that are in our tree, but for which we're # not yet ready for this compiler. Note: we likely only really "support" # building with gcc 4.8 and newer. Nothing older has been tested. @@ -40,6 +41,10 @@ CWARNEXTRA?= -Wno-error=inline -Wno-error=enum-compare -Wno-error=unused-but-set -Wno-error=array-bounds -Wno-error=address \ -Wno-error=cast-qual -Wno-error=sequence-point -Wno-error=attributes \ -Wno-error=strict-overflow -Wno-error=overflow +.else +# For gcc 4.2, eliminate the too-often-wrong warnings about uninitialized vars. +CWARNEXTRA?= -Wno-uninitialized +.endif .endif # External compilers may not support our format extensions. Allow them |