From 8cd9ca77b0c05900374e94d3fc074db195bd779f Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Mon, 27 Mar 2017 19:16:33 -0400 Subject: [PATCH] Fix some C warnings on PPC build --- src/runtime/alloc.c | 2 +- src/runtime/monitor.c | 2 +- src/runtime/ppc-arch.c | 12 +++++------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/runtime/alloc.c b/src/runtime/alloc.c index 6bf0d9935..1150941eb 100644 --- a/src/runtime/alloc.c +++ b/src/runtime/alloc.c @@ -23,7 +23,7 @@ #ifdef LISP_FEATURE_GENCGC lispobj alloc_code_object (unsigned boxed, unsigned unboxed) { struct code * code; - struct thread *th = arch_os_get_current_thread(); + struct thread __attribute__((unused)) *th = arch_os_get_current_thread(); /* boxed is the number of constants, add other slots, align it to * two words, so that the code start is aligned, and convert it to * bytes. */ diff --git a/src/runtime/monitor.c b/src/runtime/monitor.c index c410da9f7..9fae87fed 100644 --- a/src/runtime/monitor.c +++ b/src/runtime/monitor.c @@ -202,7 +202,7 @@ kill_cmd(char **ptr) static void regs_cmd(char **ptr) { - struct thread *thread=arch_os_get_current_thread(); + struct thread __attribute__((unused)) *thread=arch_os_get_current_thread(); printf("CSP\t=\t%p ", access_control_stack_pointer(thread)); #if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64) diff --git a/src/runtime/ppc-arch.c b/src/runtime/ppc-arch.c index 67bfe6503..67e3448cf 100644 --- a/src/runtime/ppc-arch.c +++ b/src/runtime/ppc-arch.c @@ -271,14 +271,11 @@ arch_do_displaced_inst(os_context_t *context, unsigned int orig_inst) static int allocation_trap_p(os_context_t * context) { - int result; unsigned int *pc; unsigned inst; unsigned opcode; unsigned src; - unsigned dst; - - result = 0; + unsigned __attribute__((unused)) dst; /* * First, the instruction has to be a TWLGE temp, NL3, which has the @@ -331,7 +328,8 @@ handle_allocation_trap(os_context_t * context) { unsigned int *pc; unsigned int inst; - unsigned int target, target_ptr, end_addr; + unsigned int target; + unsigned int __attribute__((unused)) target_ptr, end_addr; unsigned int opcode; int size; boolean were_in_lisp; @@ -496,9 +494,9 @@ handle_allocation_trap(os_context_t * context) * instructions when threading is enabled and four instructions * otherwise. */ #ifdef LISP_FEATURE_SB_THREAD - (*os_context_pc_addr(context)) = pc + 2; + (*os_context_pc_addr(context)) = (unsigned int)(pc + 2); #else - (*os_context_pc_addr(context)) = pc + 4; + (*os_context_pc_addr(context)) = (unsigned int)(pc + 4); #endif } -- 2.11.4.GIT