[PATCH 3/3] Fix compilation warnings on ARM

Dmitry V. Levin ldv at altlinux.org
Thu Dec 4 02:06:44 UTC 2008


2008-11-13  Kirill A. Shutemov  <kas at altlinux.org>

	Fix compilation warnings on ARM.
	* signal.c (sys_sigreturn) [ARM]: Fix cast.
	* syscall.c (decode_subcall) Do not define on ARM EABI.
	(get_scno) [ARM]: Fix cast.
	(syscall_fixup, syscall_enter): Do not define pid variable on ARM.

--- signal.c
+++ signal.c
@@ -1242,7 +1242,7 @@ struct tcb *tcp;
 	if (entering(tcp)) {
 		tcp->u_arg[0] = 0;
 
-		if (ptrace(PTRACE_GETREGS, tcp->pid, NULL, (void *)&regs) == -1)
+		if (ptrace(PTRACE_GETREGS, tcp->pid, NULL, (unsigned long)&regs) == -1)
 			return 0;
 
 		if (umove(tcp, regs.ARM_sp, &sc) < 0)
--- syscall.c
+++ syscall.c
@@ -582,7 +582,7 @@ static const struct subcall subcalls_table[] = {
 };
 #endif /* FREEBSD */
 
-#if !(defined(LINUX) && ( defined(ALPHA) || defined(MIPS) ))
+#if !(defined(LINUX) && ( defined(ALPHA) || defined(MIPS) || defined(__ARM_EABI__) ))
 
 static void
 decode_subcall(tcp, subcall, nsubcalls, style)
@@ -1006,7 +1006,7 @@ struct tcb *tcp;
 	/*
 	 * Read complete register set in one go.
 	 */
-	if (ptrace(PTRACE_GETREGS, pid, NULL, (void *)&regs) == -1)
+	if (ptrace(PTRACE_GETREGS, pid, NULL, (unsigned long)&regs) == -1)
 		return -1;
 
 	/*
@@ -1034,7 +1034,7 @@ struct tcb *tcp;
 			 * Get the ARM-mode system call number
 			 */
 			errno = 0;
-			scno = ptrace(PTRACE_PEEKTEXT, pid, (void *)(regs.ARM_pc - 4), NULL);
+			scno = ptrace(PTRACE_PEEKTEXT, pid, (void *)(regs.ARM_pc - 4), 0);
 			if (errno)
 				return -1;
 
@@ -1342,7 +1342,9 @@ syscall_fixup(tcp)
 struct tcb *tcp;
 {
 #ifndef USE_PROCFS
+#ifndef ARM
 	int pid = tcp->pid;
+#endif
 #else /* USE_PROCFS */
 	int scno = known_scno(tcp);
 
@@ -1956,9 +1958,9 @@ static int
 syscall_enter(tcp)
 struct tcb *tcp;
 {
-#ifndef USE_PROCFS
+#if !defined(USE_PROCFS) && !defined(ARM)
 	int pid = tcp->pid;
-#endif /* !USE_PROCFS */
+#endif /* !USE_PROCFS && !ARM */
 #ifdef LINUX
 #if defined(S390) || defined(S390X)
 	{


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20081204/b4223af9/attachment.bin>


More information about the Strace-devel mailing list