Use -Werror in external/bison
* Suppress existing warnings, to catch new warnings.
* No -Werror for darwin host yet. Need to fix/suppress more warnings.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I3e70fae74dc0ac99ab54e021d31d6af2de675434
diff --git a/Android.mk b/Android.mk
index 59fa45f..cb8753b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -14,6 +14,13 @@
LOCAL_PATH:= $(call my-dir)
+ifeq ($(HOST_OS),darwin)
+# No -Werror for darwin yet. Need to fix/suppress more warnings.
+BISON_WERROR :=
+else
+BISON_WERROR := -Werror
+endif
+
###########################################
include $(CLEAR_VARS)
@@ -132,6 +139,8 @@
lib/fcntl.c
endif
+LOCAL_CFLAGS := $(BISON_WERROR) -Wall -Wno-sign-compare
+
include $(BUILD_HOST_STATIC_LIBRARY)
###########################################
@@ -145,6 +154,13 @@
LOCAL_CFLAGS := -DPKGDATADIR=\"$(LOCAL_PATH)/data\"
+LOCAL_CFLAGS := -DPKGDATADIR=\"$(LOCAL_PATH)/data\" \
+ -Wall \
+ $(BISON_WERROR) \
+ -Wno-sign-compare \
+ -Wno-sometimes-uninitialized \
+ -Wno-unused-parameter \
+
LOCAL_STATIC_LIBRARIES := libbison
LOCAL_SRC_FILES := \
@@ -186,3 +202,5 @@
src/uniqstr.c
include $(BUILD_HOST_EXECUTABLE)
+
+BISON_WERROR :=