Turn on -Wunused and fix the mistakes it uncovers.
Change-Id: I023d2d8b547fbc21d4124bb7510d42b06a0dc501
This commit is contained in:
parent
2f9400b679
commit
d286796fce
@ -24,7 +24,7 @@ LOCAL_PATH := $(call my-dir)
|
||||
|
||||
benchmark_c_flags = \
|
||||
-O2 \
|
||||
-Wall -Wextra \
|
||||
-Wall -Wextra -Wunused \
|
||||
-Werror \
|
||||
-fno-builtin \
|
||||
-std=gnu++11 \
|
||||
|
@ -486,7 +486,7 @@ libc_arch_static_src_files := \
|
||||
# ========================================================
|
||||
libc_common_cflags := \
|
||||
-D_LIBC=1 \
|
||||
-Wall -Wextra \
|
||||
-Wall -Wextra -Wunused \
|
||||
|
||||
# Try to catch typical 32-bit assumptions that break with 64-bit pointers.
|
||||
libc_common_cflags += \
|
||||
@ -709,7 +709,7 @@ include $(CLEAR_VARS)
|
||||
LOCAL_SRC_FILES := $(libc_upstream_openbsd_src_files)
|
||||
LOCAL_CFLAGS := \
|
||||
$(libc_common_cflags) \
|
||||
-Wno-sign-compare -Wno-uninitialized \
|
||||
-Wno-sign-compare -Wno-uninitialized -Wno-unused-parameter \
|
||||
-Werror \
|
||||
-I$(LOCAL_PATH)/upstream-openbsd/android/include \
|
||||
-I$(LOCAL_PATH)/upstream-openbsd/lib/libc/include \
|
||||
|
@ -94,7 +94,7 @@ __LIBC_HIDDEN__ void __libc_postfini() {
|
||||
// Note that the dynamic linker has also run all constructors in the
|
||||
// executable at this point.
|
||||
__noreturn void __libc_init(void* raw_args,
|
||||
void (*onexit)(void),
|
||||
void (*onexit)(void) __unused,
|
||||
int (*slingshot)(int, char**, char**),
|
||||
structors_array_t const * const structors) {
|
||||
|
||||
|
@ -85,7 +85,7 @@ static void apply_gnu_relro() {
|
||||
}
|
||||
|
||||
__noreturn void __libc_init(void* raw_args,
|
||||
void (*onexit)(void),
|
||||
void (*onexit)(void) __unused,
|
||||
int (*slingshot)(int, char**, char**),
|
||||
structors_array_t const * const structors) {
|
||||
KernelArgumentBlock args(raw_args);
|
||||
|
@ -22,7 +22,7 @@ LOCAL_LDFLAGS_x86 := -Wl,--exclude-libs=libgcc_eh.a
|
||||
LOCAL_LDFLAGS_x86_64 := $(LOCAL_LDFLAGS_x86)
|
||||
|
||||
LOCAL_SRC_FILES:= libdl.c
|
||||
LOCAL_CFLAGS := -Wall -Wextra -Werror
|
||||
LOCAL_CFLAGS := -Wall -Wextra -Wunused -Werror
|
||||
|
||||
LOCAL_MODULE := libdl
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
||||
|
@ -26,7 +26,7 @@ LOCAL_CFLAGS += \
|
||||
-fno-stack-protector \
|
||||
-Wstrict-overflow=5 \
|
||||
-fvisibility=hidden \
|
||||
-Wall -Wextra -Werror \
|
||||
-Wall -Wextra -Wunused -Werror \
|
||||
|
||||
LOCAL_CONLYFLAGS += \
|
||||
-std=gnu99 \
|
||||
|
@ -59,7 +59,6 @@ class LinkedList {
|
||||
|
||||
template<typename F>
|
||||
void remove_if(F&& predicate) {
|
||||
LinkedListEntry<T>* e = head_;
|
||||
for (LinkedListEntry<T>* e = head_; e != nullptr; e = e->next) {
|
||||
if (e->element != nullptr && predicate(e->element)) {
|
||||
e->element = nullptr;
|
||||
|
@ -827,7 +827,7 @@ void do_android_update_LD_LIBRARY_PATH(const char* ld_library_path) {
|
||||
}
|
||||
}
|
||||
|
||||
soinfo* do_dlopen(const char* name, int flags, soinfo* caller, const android_dlextinfo* extinfo) {
|
||||
soinfo* do_dlopen(const char* name, int flags, soinfo* /*caller*/, const android_dlextinfo* extinfo) {
|
||||
if ((flags & ~(RTLD_NOW|RTLD_LAZY|RTLD_LOCAL|RTLD_GLOBAL|RTLD_NOLOAD)) != 0) {
|
||||
DL_ERR("invalid flags to dlopen: %x", flags);
|
||||
return NULL;
|
||||
|
@ -26,7 +26,7 @@ LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
|
||||
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
||||
|
||||
LOCAL_CFLAGS += -g -Wall -Wextra -Werror -std=gnu++11
|
||||
LOCAL_CFLAGS += -g -Wall -Wextra -Wunused -Werror -std=gnu++11
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../libc/
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
|
@ -34,7 +34,7 @@ endif
|
||||
test_cflags = \
|
||||
-fstack-protector-all \
|
||||
-g \
|
||||
-Wall -Wextra \
|
||||
-Wall -Wextra -Wunused \
|
||||
-Werror \
|
||||
-fno-builtin \
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user