From: Dmitry V. Levin Date: Sun, 15 Feb 2015 00:08:11 +0000 (+0000) Subject: i386: fix compilation warning X-Git-Tag: v4.10~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f97a4774d2d3235ebd42f92fec3f3cbec69ebbae;p=strace i386: fix compilation warning Some gcc versions complain about assigning long* to uint32_t* on i386. * syscall.c [I386] (i386_esp_ptr): Change type from uint32_t* to long*. * linux/i386/arch_regs.h (i386_esp_ptr): Likewise. * linux/x86_64/arch_regs.h: Do not include "i386/arch_regs.h". (i386_esp_ptr): New prototype. --- diff --git a/linux/i386/arch_regs.h b/linux/i386/arch_regs.h index eeb4ebea..77984ff7 100644 --- a/linux/i386/arch_regs.h +++ b/linux/i386/arch_regs.h @@ -1 +1 @@ -extern uint32_t *const i386_esp_ptr; +extern long *const i386_esp_ptr; diff --git a/linux/x86_64/arch_regs.h b/linux/x86_64/arch_regs.h index ced226ff..eeb4ebea 100644 --- a/linux/x86_64/arch_regs.h +++ b/linux/x86_64/arch_regs.h @@ -1 +1 @@ -#include "i386/arch_regs.h" +extern uint32_t *const i386_esp_ptr; diff --git a/syscall.c b/syscall.c index 209542c7..5e1e021d 100644 --- a/syscall.c +++ b/syscall.c @@ -661,8 +661,7 @@ getrval2(struct tcb *tcp) #if defined(I386) static struct user_regs_struct i386_regs; -/* Cast suppresses signedness warning (.esp is long, not unsigned long) */ -uint32_t *const i386_esp_ptr = (uint32_t*)&i386_regs.esp; +long *const i386_esp_ptr = &i386_regs.esp; # define ARCH_REGS_FOR_GETREGS i386_regs #elif defined(X86_64) || defined(X32) /*