summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-11-05 02:42:56 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-11-05 02:42:56 +0000
commit78a3233313260665fe82ba56257855e043bca3d4 (patch)
tree46622bf088b3f30d2c6d8a5b548519137c88c867 /build
parentfe50a0f644bf57a92612d08ad21dc4ea5a2f652a (diff)
parent277ccbd200ea43590dfc06a93ae184a765327ad0 (diff)
downloadart-78a3233313260665fe82ba56257855e043bca3d4.zip
art-78a3233313260665fe82ba56257855e043bca3d4.tar.gz
art-78a3233313260665fe82ba56257855e043bca3d4.tar.bz2
Merge "ART: More warnings"
Diffstat (limited to 'build')
-rw-r--r--build/Android.common_build.mk30
1 files changed, 29 insertions, 1 deletions
diff --git a/build/Android.common_build.mk b/build/Android.common_build.mk
index 84d77f8..7e58f5c 100644
--- a/build/Android.common_build.mk
+++ b/build/Android.common_build.mk
@@ -156,15 +156,36 @@ art_clang_cflags += -Wimplicit-fallthrough
# Enable float equality warnings.
art_clang_cflags += -Wfloat-equal
+# Enable warning of converting ints to void*.
+art_clang_cflags += -Wint-to-void-pointer-cast
+
+# GCC-only warnings.
+art_gcc_cflags := -Wunused-but-set-parameter
+# Suggest const: too many false positives, but good for a trial run.
+# -Wsuggest-attribute=const
+# Useless casts: too many, as we need to be 32/64 agnostic, but the compiler knows.
+# -Wuseless-cast
+# Zero-as-null: Have to convert all NULL and "diagnostic ignore" all includes like libnativehelper
+# that are still stuck pre-C++11.
+# -Wzero-as-null-pointer-constant \
+# Suggest final: Have to move to a more recent GCC.
+# -Wsuggest-final-types
+
+
ifeq ($(ART_HOST_CLANG),true)
ART_HOST_CFLAGS += $(art_clang_cflags)
+else
+ ART_HOST_CFLAGS += $(art_gcc_cflags)
endif
ifeq ($(ART_TARGET_CLANG),true)
ART_TARGET_CFLAGS += $(art_clang_cflags)
+else
+ ART_TARGET_CFLAGS += $(art_gcc_cflags)
endif
-# Clear local variable now its use has ended.
+# Clear local variables now their use has ended.
art_clang_cflags :=
+art_gcc_cflags :=
ART_CPP_EXTENSION := .cc
@@ -187,9 +208,16 @@ art_cflags := \
-Wstrict-aliasing \
-fstrict-aliasing \
-Wunreachable-code \
+ -Wno-conversion-null \
+ -Wredundant-decls \
+ -Wshadow \
-fvisibility=protected \
$(art_default_gc_type_cflags)
+# Missing declarations: too many at the moment, as we use "extern" quite a bit.
+# -Wmissing-declarations \
+
+
ifeq ($(ART_SMALL_MODE),true)
art_cflags += -DART_SMALL_MODE=1
endif