Force some clang Werrors that *will* break things.
Clang is really aggressive at optimizing a handful of cases (read:
clang will ruin your day some if you write bad code). Fortunately, it
also emits a warning when it's about to do this.
To prevent anyone from suffering from these optimizations, make these
warnings errors and make them impossible to disable.
Change-Id: I5e10bb0fc2ca23190017da716b3b84635577a0bd
diff --git a/core/config.mk b/core/config.mk
index 502dd7a..07c392a 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -117,10 +117,15 @@
COMMON_GLOBAL_CPPFLAGS:= $(COMMON_GLOBAL_CFLAGS) -Wsign-promo -std=gnu++11
COMMON_RELEASE_CPPFLAGS:= $(COMMON_RELEASE_CFLAGS)
-GLOBAL_CFLAGS_NO_OVERRIDE := \
+GLOBAL_CFLAGS_NO_OVERRIDE := \
-Werror=int-to-pointer-cast \
-Werror=pointer-to-int-cast \
+GLOBAL_CLANG_CFLAGS_NO_OVERRIDE := \
+ -Werror=address-of-temporary \
+ -Werror=null-dereference \
+ -Werror=return-type \
+
GLOBAL_CPPFLAGS_NO_OVERRIDE :=
# Set the extensions used for various packages