Use -Werror in hardware/libhardware/modules
* Remove unused local variables.
* Remove or comment out unused static functions.
* Fix trivial bugs found by unused value warnings.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I99389b883c89551850180d25241a35a40bb77b26
diff --git a/modules/vehicle/Android.mk b/modules/vehicle/Android.mk
index 34c943c..ad2e527 100644
--- a/modules/vehicle/Android.mk
+++ b/modules/vehicle/Android.mk
@@ -21,6 +21,7 @@
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_PROPRIETARY_MODULE := true
LOCAL_SRC_FILES := vehicle.c timeUtil.cpp
+LOCAL_CFLAGS := -Wall -Werror
LOCAL_HEADER_LIBRARIES := libhardware_headers
LOCAL_SHARED_LIBRARIES := liblog libcutils libutils
LOCAL_MODULE_TAGS := optional
diff --git a/modules/vehicle/vehicle.c b/modules/vehicle/vehicle.c
index 66e29c0..66a2137 100644
--- a/modules/vehicle/vehicle.c
+++ b/modules/vehicle/vehicle.c
@@ -465,6 +465,9 @@
}
int ret_code = pthread_create(
&sub->thread, NULL, (void *(*)(void*))fake_event_thread, sub);
+ if (ret_code != 0) {
+ return -ret_code;
+ }
print_subscribe_info(impl);
pthread_mutex_unlock(&lock_);
return 0;