diff options
author | Andreas Gampe <agampe@google.com> | 2015-04-03 19:41:34 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2015-04-03 20:14:40 -0700 |
commit | ca71458862be8505330b7fd5649a062f31d143dc (patch) | |
tree | 7bc749056ab65906a147cc8e1d92e8be3ffea2cc /build | |
parent | 9d231cc422b7b32d00bd43ca6993b2dd7e9989ea (diff) | |
download | art-ca71458862be8505330b7fd5649a062f31d143dc.zip art-ca71458862be8505330b7fd5649a062f31d143dc.tar.gz art-ca71458862be8505330b7fd5649a062f31d143dc.tar.bz2 |
ART: Add Clang's -Wused-but-marked-unused
Add detection of wrong unused annotations. Fix our codebase.
Change-Id: I85cc20f2eac71c1ec6c5c7cd6efb08454a629634
Diffstat (limited to 'build')
-rw-r--r-- | build/Android.common_build.mk | 4 | ||||
-rw-r--r-- | build/Android.gtest.mk | 4 |
2 files changed, 8 insertions, 0 deletions
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 @@ art_clang_cflags += -Wfloat-equal # 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. diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk index 1e7988a..86cc5ad 100644 --- a/build/Android.gtest.mk +++ b/build/Android.gtest.mk @@ -257,6 +257,7 @@ LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk LOCAL_ADDITIONAL_DEPENDENCIES += art/build/Android.gtest.mk $(eval $(call set-target-local-clang-vars)) $(eval $(call set-target-local-cflags-vars,debug)) +LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused # gtest issue include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) @@ -271,6 +272,7 @@ LOCAL_STATIC_LIBRARIES := libgtest_host LOCAL_LDLIBS += -ldl -lpthread LOCAL_MULTILIB := both LOCAL_CLANG := $(ART_HOST_CLANG) +LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused # gtest issue LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk LOCAL_ADDITIONAL_DEPENDENCIES += art/build/Android.gtest.mk include $(BUILD_HOST_SHARED_LIBRARY) @@ -423,6 +425,7 @@ define define-art-gtest LOCAL_MODULE_PATH_32 := $$(ART_TARGET_NATIVETEST_OUT)/$$(ART_TARGET_ARCH_32) LOCAL_MODULE_PATH_64 := $$(ART_TARGET_NATIVETEST_OUT)/$$(ART_TARGET_ARCH_64) LOCAL_MULTILIB := both + LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused # gtest issue include $$(BUILD_EXECUTABLE) library_path := 2nd_library_path := @@ -461,6 +464,7 @@ test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_GTEST_$$(art_gtest_ LOCAL_MULTILIB := both LOCAL_MODULE_STEM_32 := $$(art_gtest_name)32 LOCAL_MODULE_STEM_64 := $$(art_gtest_name)64 + LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused # gtest issue include $$(BUILD_HOST_EXECUTABLE) ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES := |