summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Christopher Wiley <wiley@google.com> 2015-08-24 15:06:58 -0700
committer Christopher Wiley <wiley@google.com> 2015-08-30 11:01:31 -0700
commiteea2353a3427f7d157c46e24ab6aba1378e16c2e (patch)
treeb9f6b03e1ebeb8225d820de694ff7260a11d186d
parent3fc6f441ac88aff88a9c474bd1ae93dfde3ed11a (diff)
Tighten up compiler flags for aidl
Turn all warnings to errors, with special cases for places where yacc forces us to be lenient. Remove one variable with 0 references elsewhere in the code. Change-Id: Ia7819795eb162e9c77d215088aee4c45bd87c1af
-rw-r--r--tools/aidl/Android.mk12
-rw-r--r--tools/aidl/aidl.cpp5
2 files changed, 11 insertions, 6 deletions
diff --git a/tools/aidl/Android.mk b/tools/aidl/Android.mk
index efd60a2cda99..9554e4291d41 100644
--- a/tools/aidl/Android.mk
+++ b/tools/aidl/Android.mk
@@ -8,6 +8,17 @@ ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_CFLAGS := -g -Wall -Werror
+# Tragically, the code is riddled with unused parameters.
+LOCAL_CFLAGS += -Wno-unused-parameter
+# yacc dumps a lot of code *just in case*.
+LOCAL_CFLAGS += -Wno-unused-function
+LOCAL_CFLAGS += -Wno-unneeded-internal-declaration
+# yacc is a tool from a more civilized age.
+LOCAL_CFLAGS += -Wno-deprecated-register
+# yacc also has a habit of using char* over const char*.
+LOCAL_CFLAGS += -Wno-writable-strings
+
LOCAL_SRC_FILES := \
aidl_language_l.l \
aidl_language_y.y \
@@ -21,7 +32,6 @@ LOCAL_SRC_FILES := \
generate_java_binder.cpp \
generate_java_rpc.cpp
-LOCAL_CFLAGS := -g
LOCAL_MODULE := aidl
include $(BUILD_HOST_EXECUTABLE)
diff --git a/tools/aidl/aidl.cpp b/tools/aidl/aidl.cpp
index 2d8f0acf8bb5..0df9f065381a 100644
--- a/tools/aidl/aidl.cpp
+++ b/tools/aidl/aidl.cpp
@@ -165,11 +165,6 @@ import_import_parsed(buffer_type* statement)
{
}
-static ParserCallbacks g_importCallbacks = {
- &main_document_parsed,
- &import_import_parsed
-};
-
// ==========================================================
static int
check_filename(const char* filename, const char* package, buffer_type* name)