]> granicus.if.org Git - strace/commitdiff
i386: fix compilation warning
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 15 Feb 2015 00:08:11 +0000 (00:08 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 15 Feb 2015 00:08:11 +0000 (00:08 +0000)
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.

linux/i386/arch_regs.h
linux/x86_64/arch_regs.h
syscall.c

index eeb4ebea868c468139747908a44567120efc05fd..77984ff7c315abcab1afb1a152dcffef92ab6acb 100644 (file)
@@ -1 +1 @@
-extern uint32_t *const i386_esp_ptr;
+extern long *const i386_esp_ptr;
index ced226ff0d42afd33f6ec5aec7c80527cb2d66f1..eeb4ebea868c468139747908a44567120efc05fd 100644 (file)
@@ -1 +1 @@
-#include "i386/arch_regs.h"
+extern uint32_t *const i386_esp_ptr;
index 209542c7292f3f46dc37dfed0a8a3bd015cda9e4..5e1e021da9c1ef516f59c28bbdd567b42835358e 100644 (file)
--- 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)
 /*