[Ltrace-devel] [PATCH] fix variable type in set_instruction_pointer

Olaf Hering olh at suse.de
Thu Sep 14 11:03:26 UTC 2006


regs.c:28: warning: cast from pointer to integer of different size

What is the purpose of the long cast of newip?

---
 sysdeps/linux-gnu/ia64/regs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: ltrace-0.4/sysdeps/linux-gnu/ia64/regs.c
===================================================================
--- ltrace-0.4.orig/sysdeps/linux-gnu/ia64/regs.c
+++ ltrace-0.4/sysdeps/linux-gnu/ia64/regs.c
@@ -25,11 +25,11 @@ void set_instruction_pointer(struct proc
 {
 
 	unsigned long newip = (unsigned long)addr;
-	int slot = (int)addr & 0xf;
+	unsigned long slot = (unsigned long)addr & 0xf;
 	unsigned long psr = ptrace(PTRACE_PEEKUSER, proc->pid, PT_CR_IPSR, 0);
 
 	psr &= ~(3UL << 41);
-	psr |= (unsigned long)(slot & 0x3) << 41;
+	psr |= (slot & 0x3) << 41;
 
 	newip &= ~0xfUL;
 



More information about the Ltrace-devel mailing list