diff options
| author | Dan Willemsen <dwillemsen@google.com> | 2017-11-29 18:06:11 -0800 |
|---|---|---|
| committer | Dan Willemsen <dwillemsen@google.com> | 2017-11-29 21:37:28 -0800 |
| commit | 528f144e779dfd18b550d9176aecf36e1130f449 (patch) | |
| tree | f8b8faf502550eabda14c99bcaffd4f3d25a205d | |
| parent | 70fda27eb2a72958636c8026be7cc72881bdff25 (diff) | |
| download | system_core-528f144e779dfd18b550d9176aecf36e1130f449.tar.gz system_core-528f144e779dfd18b550d9176aecf36e1130f449.tar.bz2 system_core-528f144e779dfd18b550d9176aecf36e1130f449.zip | |
Fix / suppress new unused warnings for mingw+clang
Bug: 69933068
Test: mmma system/core
Change-Id: I089166a979d3d8c5ada38a7745d507b555048499
| -rw-r--r-- | base/Android.bp | 1 | ||||
| -rw-r--r-- | base/logging_test.cpp | 2 | ||||
| -rw-r--r-- | base/utf8.cpp | 2 | ||||
| -rw-r--r-- | fastboot/fs.cpp | 2 | ||||
| -rw-r--r-- | libcutils/sockets_windows.cpp | 2 | ||||
| -rw-r--r-- | libcutils/threads.cpp | 2 | ||||
| -rw-r--r-- | libutils/Android.bp | 7 | ||||
| -rw-r--r-- | libutils/Threads.cpp | 4 | ||||
| -rw-r--r-- | libutils/misc.cpp | 6 |
9 files changed, 18 insertions, 10 deletions
diff --git a/base/Android.bp b/base/Android.bp index 7ff02a0ee..ad0edf4a9 100644 --- a/base/Android.bp +++ b/base/Android.bp @@ -129,6 +129,7 @@ cc_test { }, windows: { srcs: ["utf8_test.cpp"], + cflags: ["-Wno-unused-parameter"], enabled: true, }, }, diff --git a/base/logging_test.cpp b/base/logging_test.cpp index adb041b32..6f05d9b7f 100644 --- a/base/logging_test.cpp +++ b/base/logging_test.cpp @@ -192,6 +192,7 @@ TEST(logging, WOULD_LOG_VERBOSE_enabled) { #undef CHECK_WOULD_LOG_ENABLED +#if !defined(_WIN32) static std::string make_log_pattern(android::base::LogSeverity severity, const char* message) { static const char log_characters[] = "VDIWEFF"; @@ -203,6 +204,7 @@ static std::string make_log_pattern(android::base::LogSeverity severity, "%c \\d+-\\d+ \\d+:\\d+:\\d+ \\s*\\d+ \\s*\\d+ %s:\\d+] %s", log_char, basename(&holder[0]), message); } +#endif static void CheckMessage(const CapturedStderr& cap, android::base::LogSeverity severity, const char* expected) { diff --git a/base/utf8.cpp b/base/utf8.cpp index 5984fb06c..adb46d09c 100644 --- a/base/utf8.cpp +++ b/base/utf8.cpp @@ -195,7 +195,7 @@ FILE* fopen(const char* name, const char* mode) { return _wfopen(name_utf16.c_str(), mode_utf16.c_str()); } -int mkdir(const char* name, mode_t mode) { +int mkdir(const char* name, mode_t) { std::wstring name_utf16; if (!UTF8PathToWindowsLongPath(name, &name_utf16)) { return -1; diff --git a/fastboot/fs.cpp b/fastboot/fs.cpp index 8877b09b7..98061df1b 100644 --- a/fastboot/fs.cpp +++ b/fastboot/fs.cpp @@ -27,7 +27,7 @@ using android::base::StringPrintf; using android::base::unique_fd; #ifdef WIN32 -static int exec_e2fs_cmd(const char* path, char* const argv[]) { +static int exec_e2fs_cmd(const char* /*path*/, char* const argv[]) { std::string cmd; int i = 0; while (argv[i] != nullptr) { diff --git a/libcutils/sockets_windows.cpp b/libcutils/sockets_windows.cpp index 3e49b85b4..df1471220 100644 --- a/libcutils/sockets_windows.cpp +++ b/libcutils/sockets_windows.cpp @@ -85,6 +85,6 @@ ssize_t socket_send_buffers(cutils_socket_t sock, return -1; } -int android_get_control_socket(const char* name) { +int android_get_control_socket(const char*) { return -1; } diff --git a/libcutils/threads.cpp b/libcutils/threads.cpp index beea8bdfc..a7e6b2d8e 100644 --- a/libcutils/threads.cpp +++ b/libcutils/threads.cpp @@ -84,7 +84,7 @@ void* thread_store_get( thread_store_t* store ) void thread_store_set( thread_store_t* store, void* value, - thread_store_destruct_t destroy ) + thread_store_destruct_t /*destroy*/ ) { /* XXX: can't use destructor on thread exit */ if (!store->lock_init) { diff --git a/libutils/Android.bp b/libutils/Android.bp index 4bd2a9859..6b50f0cff 100644 --- a/libutils/Android.bp +++ b/libutils/Android.bp @@ -136,9 +136,12 @@ cc_library { cflags: ["-Wno-unused-parameter"], }, - // Under MinGW, ctype.h doesn't need multi-byte support windows: { - cflags: ["-DMB_CUR_MAX=1"], + cflags: [ + // Under MinGW, ctype.h doesn't need multi-byte support + "-DMB_CUR_MAX=1", + "-Wno-unused-private-field", + ], enabled: true, }, diff --git a/libutils/Threads.cpp b/libutils/Threads.cpp index 6317c32d4..7d7f0e283 100644 --- a/libutils/Threads.cpp +++ b/libutils/Threads.cpp @@ -348,7 +348,7 @@ Mutex::Mutex() mState = (void*) hMutex; } -Mutex::Mutex(const char* name) +Mutex::Mutex(const char* /*name*/) { // XXX: name not used for now HANDLE hMutex; @@ -359,7 +359,7 @@ Mutex::Mutex(const char* name) mState = (void*) hMutex; } -Mutex::Mutex(int type, const char* name) +Mutex::Mutex(int /*type*/, const char* /*name*/) { // XXX: type and name not used for now HANDLE hMutex; diff --git a/libutils/misc.cpp b/libutils/misc.cpp index d95fd056b..da28dfae6 100644 --- a/libutils/misc.cpp +++ b/libutils/misc.cpp @@ -44,8 +44,8 @@ static pthread_mutex_t gSyspropMutex = PTHREAD_MUTEX_INITIALIZER; static Vector<sysprop_change_callback_info>* gSyspropList = NULL; #endif -void add_sysprop_change_callback(sysprop_change_callback cb, int priority) { #if !defined(_WIN32) +void add_sysprop_change_callback(sysprop_change_callback cb, int priority) { pthread_mutex_lock(&gSyspropMutex); if (gSyspropList == NULL) { gSyspropList = new Vector<sysprop_change_callback_info>(); @@ -65,8 +65,10 @@ void add_sysprop_change_callback(sysprop_change_callback cb, int priority) { gSyspropList->add(info); } pthread_mutex_unlock(&gSyspropMutex); -#endif } +#else +void add_sysprop_change_callback(sysprop_change_callback, int) {} +#endif #if defined(__ANDROID__) void (*get_report_sysprop_change_func())() { |
