From fb81db2f4d4098e1edfd98521fc0c40bd796cbc4 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Sat, 22 Feb 2020 19:28:56 -0800 Subject: [PATCH] soong: globally enable -Wunreachable-code-loop-increment This warning only flags code that's otherwise pretty trivial to refactor into something more readable. It also catches nasty bugs, so turning it on seems like a good idea. Bug: 150166387 Test: TreeHugger Change-Id: I0e095d83ba4a2dcd81f680efd8ea3d2a6fe1a970 --- cc/config/global.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cc/config/global.go b/cc/config/global.go index d01dd843e..38f5131f8 100644 --- a/cc/config/global.go +++ b/cc/config/global.go @@ -31,6 +31,7 @@ var ( "-Wno-unused", "-Winit-self", "-Wpointer-arith", + "-Wunreachable-code-loop-increment", // Make paths in deps files relative "-no-canonical-prefixes", @@ -50,6 +51,7 @@ var ( "-Werror=date-time", "-Werror=pragma-pack", "-Werror=pragma-pack-suspicious-include", + "-Werror=unreachable-code-loop-increment", } commonGlobalConlyflags = []string{}