From 4e31fb87afd4b067e6905ef52e38cb663beaa387 Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Wed, 30 Oct 2019 13:55:26 -0700 Subject: [PATCH] soong: move -Wimplicit-fallthrough from cflags to cxxflags The compiler upgrade to r370808 can now check C code for implicit fallthrough. This is triggering a massive number of warnings throughout external/ and the rest of the platform. Revisit enabling this for C another day. Bug: 139945549 Test: m Change-Id: I8dfaedab78c6230b46e8a45a9e65106dec363380 Signed-off-by: Nick Desaulniers --- cc/config/clang.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cc/config/clang.go b/cc/config/clang.go index 71bea4263..b42074b23 100644 --- a/cc/config/clang.go +++ b/cc/config/clang.go @@ -101,9 +101,6 @@ func init() { // not emit the table by default on Android since NDK still uses GNU binutils. "-faddrsig", - // -Wimplicit-fallthrough is not enabled by -Wall. - "-Wimplicit-fallthrough", - // Help catch common 32/64-bit errors. "-Werror=int-conversion", @@ -138,6 +135,9 @@ func init() { }, " ")) pctx.StaticVariable("ClangExtraCppflags", strings.Join([]string{ + // -Wimplicit-fallthrough is not enabled by -Wall. + "-Wimplicit-fallthrough", + // Enable clang's thread-safety annotations in libcxx. // Turn off -Wthread-safety-negative, to avoid breaking projects that use -Weverything. "-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS",