From bd783f13c1d7b2a3f556a091cdd7be51c86a08d8 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Tue, 14 Aug 2018 13:20:38 -0700 Subject: [PATCH] Add default -Wimplicit-fallthrough. After we fix all existing such warnings, it can be changed to an error. Bug: 112564944 Test: make checkbuild Change-Id: I61ee3a24a3f992ef018cfe6c995e957416551183 --- cc/config/clang.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cc/config/clang.go b/cc/config/clang.go index 5e22d6a24..5cf24219e 100644 --- a/cc/config/clang.go +++ b/cc/config/clang.go @@ -103,6 +103,10 @@ func init() { pctx.StaticVariable("ClangExtraCflags", strings.Join([]string{ "-D__compiler_offsetof=__builtin_offsetof", + // Make implicit fallthrough an error in the future. + "-Wimplicit-fallthrough", + "-Wno-error=implicit-fallthrough", + // Help catch common 32/64-bit errors. "-Werror=int-conversion",