From b149e245c8ccd90b52227f3d07ab572080afac53 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Wed, 30 Apr 2014 09:39:09 -0700 Subject: [PATCH] logcat: turn on -Werror - Deal with some -Wunused issues Change-Id: Ic4ab9a49f13e156a73d40266e413dee3e6396178 --- logcat/Android.mk | 4 +++- logcat/logcat.cpp | 3 --- logcat/tests/logcat_test.cpp | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/logcat/Android.mk b/logcat/Android.mk index b5e27eb45..f46a4deb6 100644 --- a/logcat/Android.mk +++ b/logcat/Android.mk @@ -7,7 +7,9 @@ LOCAL_SRC_FILES:= logcat.cpp event.logtags LOCAL_SHARED_LIBRARIES := liblog -LOCAL_MODULE:= logcat +LOCAL_MODULE := logcat + +LOCAL_CFLAGS := -Werror include $(BUILD_EXECUTABLE) diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp index 995a42e07..41a4fae42 100644 --- a/logcat/logcat.cpp +++ b/logcat/logcat.cpp @@ -496,9 +496,6 @@ int main(int argc, char **argv) android::g_logRotateSizeKBytes = DEFAULT_LOG_ROTATE_SIZE_KBYTES; } else { - long logRotateSize; - char *lastDigit; - if (!isdigit(optarg[0])) { fprintf(stderr,"Invalid parameter to -r\n"); android::show_help(argv[0]); diff --git a/logcat/tests/logcat_test.cpp b/logcat/tests/logcat_test.cpp index b07cc8b53..2e8ae8b6d 100644 --- a/logcat/tests/logcat_test.cpp +++ b/logcat/tests/logcat_test.cpp @@ -392,7 +392,7 @@ TEST(logcat, get_) { ASSERT_EQ(4, count); } -static void caught_blocking(int signum) +static void caught_blocking(int /*signum*/) { unsigned long long v = 0xDEADBEEFA55A0000ULL; @@ -461,7 +461,7 @@ TEST(logcat, blocking) { EXPECT_EQ(1, signals); } -static void caught_blocking_tail(int signum) +static void caught_blocking_tail(int /*signum*/) { unsigned long long v = 0xA55ADEADBEEF0000ULL; @@ -532,7 +532,7 @@ TEST(logcat, blocking_tail) { EXPECT_EQ(1, signals); } -static void caught_blocking_clear(int signum) +static void caught_blocking_clear(int /*signum*/) { unsigned long long v = 0xDEADBEEFA55C0000ULL;