]> granicus.if.org Git - strace/commitdiff
2008-08-06 Jan Kratochvil <jan.kratochvil@redhat.com>
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 6 Aug 2008 21:38:52 +0000 (21:38 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 6 Aug 2008 21:38:52 +0000 (21:38 +0000)
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.

signal.c
strace.c
syscall.c
util.c

index 9caba795b79cb2b6cebcc152a3ebd78c8364be2f..25db0a0ec5ce61ff7f4824b2ecc177835879d079 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -1176,13 +1176,13 @@ struct tcb *tcp;
                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 @@ struct tcb *tcp;
        }
        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;
index 8a77bb14ba73d8f1e0b075e270e3c7956db4a921..cab3489a81a21b0ec3b4c315356ca7929abee57d 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -2421,11 +2421,12 @@ Process %d attached (waiting for parent)\n",
                        }
                        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);
index 428b86860c1a86708305f2b441e0f6e893d309ab..6dd93ca8dcc6637693d3882789047e74f3592876 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -1963,20 +1963,21 @@ struct tcb *tcp;
 #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 e83ee66a82a82951b06f31eac22b75c330a31f9b..8be79961224878918e014aa135064c970c7e1275 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1300,21 +1300,25 @@ typedef unsigned long *arg_setup_state;
 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;
 }