summaryrefslogtreecommitdiffstats
path: root/llvm/autoconf
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2013-01-09 22:11:13 +0000
committerDavid Greene <greened@obbligato.org>2013-01-09 22:11:13 +0000
commit9ff8d471d64cde456b14513a3b150ddab0fe8830 (patch)
tree05738bd5d2be29e63c7dc5ce1204a05f002faab0 /llvm/autoconf
parent6134a6e7b884084f0affedb5f78492eb07610163 (diff)
downloadbcm5719-llvm-9ff8d471d64cde456b14513a3b150ddab0fe8830.tar.gz
bcm5719-llvm-9ff8d471d64cde456b14513a3b150ddab0fe8830.zip
Disable -Wuninitialized for gcc
If the compiler is gcc, disable variants of -Wuninitialized depending on the gcc version. This gets a lot of false positive warnings out of the build. Generate a new configure for the gcc -Wno-uninitialized fix. Pick up -Wno-uninitialized from configure Add the option -Wno[-maybe]-uninitialized as determined by configure. llvm-svn: 172006
Diffstat (limited to 'llvm/autoconf')
-rw-r--r--llvm/autoconf/configure.ac22
1 files changed, 21 insertions, 1 deletions
diff --git a/llvm/autoconf/configure.ac b/llvm/autoconf/configure.ac
index a1426c1832d..c186ed55744 100644
--- a/llvm/autoconf/configure.ac
+++ b/llvm/autoconf/configure.ac
@@ -1257,7 +1257,27 @@ AC_MSG_CHECKING([optional compiler flags])
CXX_FLAG_CHECK(NO_VARIADIC_MACROS, [-Wno-variadic-macros])
CXX_FLAG_CHECK(NO_MISSING_FIELD_INITIALIZERS, [-Wno-missing-field-initializers])
CXX_FLAG_CHECK(COVERED_SWITCH_DEFAULT, [-Wcovered-switch-default])
-AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT])
+dnl GCC's potential uninitialized use analysis is weak and presents lots of
+dnl false positives, so disable it.
+if test "$GXX" = "yes"
+then
+ CXX_FLAG_CHECK(NO_MAYBE_UNINITIALIZED, [-Wno-maybe-uninitialized])
+ dnl gcc 4.7 introduced -Wmaybe-uninitialized to distinguish cases which are
+ dnl known to be uninitialized from cases which might be uninitialized. We
+ dnl still want to catch the first kind of errors.
+ if test "$NO_MAYBE_UNINITIALIZED" != "-Wno-maybe-uninitialized"
+ then
+ CXX_FLAG_CHECK(NO_UNINITIALIZED, [-Wno-uninitialized])
+ else
+ dnl AC_SUBST doesn't work with empty strings.
+ NO_UNINITIALIZED=
+ fi
+else
+ NO_UNINITIALIZED=
+ NO_MAYBE_UNINITIALIZED=
+fi
+AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT $NO_UNINITIALIZED $NO_MAYBE_UNINITIALIZED])
+
dnl===-----------------------------------------------------------------------===
dnl===
OpenPOWER on IntegriCloud