2008-08-06 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix compiler warnings.
* signal.c (sys_signal): Cast to SIG_* to the matching type LONG.
* strace.c (trace): Variables PSR and PC are now signed.
* syscall.c (syscall_enter): Variable RBS_END is now signed long.
Remove/add the RBS_END casts appropriately.
* util.c [IA64] (arg_setup): Variable BSP is now signed long.
Remove/add the BSP casts appropriately.
<ia32>: Initialize *STATE.
diff --git a/signal.c b/signal.c
index 9caba79..25db0a0 100644
--- a/signal.c
+++ b/signal.c
@@ -1176,13 +1176,13 @@
printsignal(tcp->u_arg[0]);
tprintf(", ");
switch (tcp->u_arg[1]) {
- case (int) SIG_ERR:
+ case (long) SIG_ERR:
tprintf("SIG_ERR");
break;
- case (int) SIG_DFL:
+ case (long) SIG_DFL:
tprintf("SIG_DFL");
break;
- case (int) SIG_IGN:
+ case (long) SIG_IGN:
#ifndef USE_PROCFS
if (tcp->u_arg[0] == SIGTRAP) {
tcp->flags |= TCB_SIGTRAPPED;
@@ -1204,11 +1204,11 @@
}
else {
switch (tcp->u_rval) {
- case (int) SIG_ERR:
+ case (long) SIG_ERR:
tcp->auxstr = "SIG_ERR"; break;
- case (int) SIG_DFL:
+ case (long) SIG_DFL:
tcp->auxstr = "SIG_DFL"; break;
- case (int) SIG_IGN:
+ case (long) SIG_IGN:
tcp->auxstr = "SIG_IGN"; break;
default:
tcp->auxstr = NULL;
diff --git a/strace.c b/strace.c
index 8a77bb1..cab3489 100644
--- a/strace.c
+++ b/strace.c
@@ -2421,11 +2421,12 @@
}
if (!cflag
&& (qual_flags[WSTOPSIG(status)] & QUAL_SIGNAL)) {
- unsigned long addr = 0, pc = 0;
+ unsigned long addr = 0;
+ long pc = 0;
#if defined(PT_CR_IPSR) && defined(PT_CR_IIP) && defined(PT_GETSIGINFO)
# define PSR_RI 41
struct siginfo si;
- unsigned long psr;
+ long psr;
upeek(pid, PT_CR_IPSR, &psr);
upeek(pid, PT_CR_IIP, &pc);
diff --git a/syscall.c b/syscall.c
index 428b868..6dd93ca 100644
--- a/syscall.c
+++ b/syscall.c
@@ -1963,20 +1963,21 @@
#elif defined (IA64)
{
if (!ia32) {
- unsigned long *out0, *rbs_end, cfm, sof, sol, i;
+ unsigned long *out0, cfm, sof, sol, i;
+ long rbs_end;
/* be backwards compatible with kernel < 2.4.4... */
# ifndef PT_RBS_END
# define PT_RBS_END PT_AR_BSP
# endif
- if (upeek(pid, PT_RBS_END, (long *) &rbs_end) < 0)
+ if (upeek(pid, PT_RBS_END, &rbs_end) < 0)
return -1;
if (upeek(pid, PT_CFM, (long *) &cfm) < 0)
return -1;
sof = (cfm >> 0) & 0x7f;
sol = (cfm >> 7) & 0x7f;
- out0 = ia64_rse_skip_regs(rbs_end, -sof + sol);
+ out0 = ia64_rse_skip_regs((unsigned long *) rbs_end, -sof + sol);
if (tcp->scno >= 0 && tcp->scno < nsyscalls
&& sysent[tcp->scno].nargs != -1)
diff --git a/util.c b/util.c
index e83ee66..8be7996 100644
--- a/util.c
+++ b/util.c
@@ -1300,21 +1300,25 @@
static int
arg_setup(struct tcb *tcp, arg_setup_state *state)
{
- unsigned long *bsp, cfm, sof, sol;
+ unsigned long cfm, sof, sol;
+ long bsp;
- if (ia32)
+ if (ia32) {
+ /* Satisfy a false GCC warning. */
+ *state = NULL;
return 0;
+ }
- if (upeek(tcp->pid, PT_AR_BSP, (long *) &bsp) < 0)
+ if (upeek(tcp->pid, PT_AR_BSP, &bsp) < 0)
return -1;
if (upeek(tcp->pid, PT_CFM, (long *) &cfm) < 0)
return -1;
sof = (cfm >> 0) & 0x7f;
sol = (cfm >> 7) & 0x7f;
- bsp = ia64_rse_skip_regs(bsp, -sof + sol);
+ bsp = (long) ia64_rse_skip_regs((unsigned long *) bsp, -sof + sol);
- *state = bsp;
+ *state = (unsigned long *) bsp;
return 0;
}