Repository: mesos Updated Branches: refs/heads/master 1f97b2844 -> f6620f851
Added -Wno-unused-local-typedef for clang 3.6. Review: https://reviews.apache.org/r/32749 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f6620f85 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f6620f85 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f6620f85 Branch: refs/heads/master Commit: f6620f851f635b3346c6ebf878152f38b3932ad9 Parents: 06dd75c Author: Cody Maloney <[email protected]> Authored: Wed Apr 15 19:47:44 2015 +0200 Committer: Till Toenshoff <[email protected]> Committed: Thu Apr 16 09:54:23 2015 +0200 ---------------------------------------------------------------------- configure.ac | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/f6620f85/configure.ac ---------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index 868c041..6346db9 100644 --- a/configure.ac +++ b/configure.ac @@ -575,6 +575,33 @@ if test "x$CLANG" = "xno"; then if test "x$is_gxx47" = "xyes"; then AC_MSG_ERROR([Unable to build with g++-4.7 due to missing C++11 features]) fi + +# CLANG=yes +else + + # Check if -Wno-unused-local-typedef is needed by checking a sample + # compilation which contains a local unused typedef. + # This is needed because Boost 1.53.0 fails to compile with upstream + # Clang 3.6 without -Wno-unused-local-typedef. Apple LLVM based on + # Clang 3.6 doesn't have the same behavior. + AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([[ + #pragma clang diagnostic error "-Wunused-local-typedef" + + int foo() + { + typedef int return_type; + return 5; + } + ]])], + [warn_local_typedefs=no], [warn_local_typedefs=yes]) + AC_LANG_POP([C++]) + + if test "x$warn_local_typedefs" = "xyes"; then + AC_MSG_NOTICE([Disabling warnings about unused local typedefs]) + CXXFLAGS="${CXXFLAGS} -Wno-unused-local-typedef" + fi fi
