<div dir="ltr">Oh painful. That said, probably about the best way of doing that.<div><br></div><div>One nit:</div><div><br></div><div style>+if test "$GXX" = "yes"</div><div style>+then</div><div style>
<br></div><div style>is usually done:</div><div style><br></div><div style>if test "x$GXX" = "xyes"; then</div><div><br></div><div style>otherwise OK. Please go ahead and commit all 3 patches in this set in the same commit.</div>
<div style><br></div><div style>Thanks!</div><div><br></div><div>-eric</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 8, 2013 at 1:11 PM, David Greene <span dir="ltr"><<a href="mailto:dag@cray.com" target="_blank">dag@cray.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If the compiler is gcc, disable variants of -Wuninitialized depending<br>
on the gcc version.  This gets a lot of false positive warnings out of<br>
the build.<br>
---<br>
 llvm/autoconf/<a href="http://configure.ac" target="_blank">configure.ac</a> |   22 +++++++++++++++++++++-<br>
 1 files changed, 21 insertions(+), 1 deletions(-)<br>
<br>
diff --git a/llvm/autoconf/<a href="http://configure.ac" target="_blank">configure.ac</a> b/llvm/autoconf/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
index 102147c..e1bb046 100644<br>
--- a/llvm/autoconf/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
+++ b/llvm/autoconf/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
@@ -1231,7 +1231,27 @@ AC_MSG_CHECKING([optional compiler flags])<br>
 CXX_FLAG_CHECK(NO_VARIADIC_MACROS, [-Wno-variadic-macros])<br>
 CXX_FLAG_CHECK(NO_MISSING_FIELD_INITIALIZERS, [-Wno-missing-field-initializers])<br>
 CXX_FLAG_CHECK(COVERED_SWITCH_DEFAULT, [-Wcovered-switch-default])<br>
-AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT])<br>
+dnl GCC's potential uninitialized use analysis is weak and presents lots of<br>
+dnl false positives, so disable it.<br>
+if test "$GXX" = "yes"<br>
+then<br>
+  CXX_FLAG_CHECK(NO_MAYBE_UNINITIALIZED, [-Wno-maybe-uninitialized])<br>
+  dnl gcc 4.7 introduced -Wmaybe-uninitialized to distinguish cases which are<br>
+  dnl known to be uninitialized from cases which might be uninitialized.  We<br>
+  dnl still want to catch the first kind of errors.<br>
+  if test "$NO_MAYBE_UNINITIALIZED" != "-Wno-maybe-uninitialized"<br>
+  then<br>
+    CXX_FLAG_CHECK(NO_UNINITIALIZED, [-Wno-uninitialized])<br>
+  else<br>
+    dnl AC_SUBST doesn't work with empty strings.<br>
+    NO_UNINITIALIZED=<br>
+  fi<br>
+else<br>
+  NO_UNINITIALIZED=<br>
+  NO_MAYBE_UNINITIALIZED=<br>
+fi<br>
+AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT $NO_UNINITIALIZED $NO_MAYBE_UNINITIALIZED])<br>
+<br>
<br>
 dnl===-----------------------------------------------------------------------===<br>
 dnl===<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.8.4<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</font></span></blockquote></div><br></div>