ART: Add Clang's -Wused-but-marked-unused
Add detection of wrong unused annotations. Fix our codebase.
Change-Id: I85cc20f2eac71c1ec6c5c7cd6efb08454a629634
diff --git a/build/Android.common_build.mk b/build/Android.common_build.mk
index 8f00298..91b6620 100644
--- a/build/Android.common_build.mk
+++ b/build/Android.common_build.mk
@@ -135,6 +135,10 @@
# Enable warning of converting ints to void*.
art_clang_cflags += -Wint-to-void-pointer-cast
+# Enable warning of wrong unused annotations.
+art_clang_cflags += -Wused-but-marked-unused
+
+
# GCC-only warnings.
art_gcc_cflags := -Wunused-but-set-parameter
# Suggest const: too many false positives, but good for a trial run.