am 6f3f7d71: Merge "debuggerd: turn on -Werror"

* commit '6f3f7d71c57940d281ae4a54c4cc33a8688c148d':
  debuggerd: turn on -Werror
This commit is contained in:
Mark Salyzyn 2014-05-02 21:43:18 +00:00 committed by Android Git Automerger
commit 44bec3ade8
3 changed files with 10 additions and 12 deletions

View file

@ -20,8 +20,7 @@ LOCAL_CPPFLAGS := -std=gnu++11
LOCAL_CFLAGS := \ LOCAL_CFLAGS := \
-Wall \ -Wall \
-Wno-array-bounds \ -Wno-array-bounds \
-Werror \ -Werror
-Wno-unused-parameter \
ifeq ($(ARCH_ARM_HAVE_VFP),true) ifeq ($(ARCH_ARM_HAVE_VFP),true)
LOCAL_CFLAGS_arm += -DWITH_VFP LOCAL_CFLAGS_arm += -DWITH_VFP
@ -55,7 +54,7 @@ LOCAL_SRC_FILES_x86 := x86/crashglue.S
LOCAL_SRC_FILES_x86_64 := x86_64/crashglue.S LOCAL_SRC_FILES_x86_64 := x86_64/crashglue.S
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_MODULE_TAGS := optional LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS += -fstack-protector-all -Wno-unused-parameter -Wno-free-nonheap-object LOCAL_CFLAGS += -fstack-protector-all -Werror -Wno-free-nonheap-object
#LOCAL_FORCE_STATIC_EXECUTABLE := true #LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_SHARED_LIBRARIES := libcutils liblog libc LOCAL_SHARED_LIBRARIES := libcutils liblog libc
@ -76,6 +75,7 @@ ifeq ($(ARCH_ARM_HAVE_VFP_D32),true)
LOCAL_CFLAGS_arm += -DWITH_VFP_D32 LOCAL_CFLAGS_arm += -DWITH_VFP_D32
endif # ARCH_ARM_HAVE_VFP_D32 endif # ARCH_ARM_HAVE_VFP_D32
endif # ARCH_ARM_HAVE_VFP == true endif # ARCH_ARM_HAVE_VFP == true
LOCAL_CFLAGS += -Werror
LOCAL_SRC_FILES_arm64 := arm64/vfp.S LOCAL_SRC_FILES_arm64 := arm64/vfp.S
LOCAL_MODULE_TARGET_ARCH += arm64 LOCAL_MODULE_TARGET_ARCH += arm64

View file

@ -82,8 +82,6 @@ void dump_registers(log_t* log, pid_t tid, int scope_flags)
io.iov_base = &r; io.iov_base = &r;
io.iov_len = sizeof(r); io.iov_len = sizeof(r);
bool only_in_tombstone = !IS_AT_FAULT(scope_flags);
if (ptrace(PTRACE_GETREGSET, tid, (void*) NT_PRSTATUS, (void*) &io) == -1) { if (ptrace(PTRACE_GETREGSET, tid, (void*) NT_PRSTATUS, (void*) &io) == -1) {
_LOG(log, scope_flags, "ptrace error: %s\n", strerror(errno)); _LOG(log, scope_flags, "ptrace error: %s\n", strerror(errno));
return; return;

View file

@ -6,13 +6,18 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/cdefs.h>
#include <sys/ptrace.h> #include <sys/ptrace.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <unistd.h> #include <unistd.h>
#include <cutils/log.h>
#include <cutils/sockets.h> #include <cutils/sockets.h>
#include <log/log.h>
#ifndef __unused
#define __unused __attribute__((__unused__))
#endif
extern const char* __progname; extern const char* __progname;
@ -26,7 +31,7 @@ static void maybe_abort() {
} }
} }
static int smash_stack(int i) { static int smash_stack(int i __unused) {
printf("crasher: deliberately corrupting stack...\n"); printf("crasher: deliberately corrupting stack...\n");
// Unless there's a "big enough" buffer on the stack, gcc // Unless there's a "big enough" buffer on the stack, gcc
// doesn't bother inserting checks. // doesn't bother inserting checks.
@ -47,11 +52,6 @@ __attribute__((noinline)) static void overflow_stack(void* p) {
overflow_stack(&buf); overflow_stack(&buf);
} }
static void test_call1()
{
*((int*) 32) = 1;
}
static void *noisy(void *x) static void *noisy(void *x)
{ {
char c = (uintptr_t) x; char c = (uintptr_t) x;