]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: msp430: fix build time warnings
authorMike Frysinger <vapier@gentoo.org>
Fri, 7 Mar 2014 04:29:37 +0000 (23:29 -0500)
committerMike Frysinger <vapier@gentoo.org>
Tue, 11 Mar 2014 02:59:22 +0000 (22:59 -0400)
This fix is simple:

msp430-sim.c: In function 'maybe_perform_syscall':
msp430-sim.c:898:10: warning: format '%d' expects argument of type 'int',
                     but argument 5 has type 'long int' [-Wformat]

This one we change to use casts like everyone else does in the code base:

msp430-sim.c: In function 'msp430_step_once':
msp430-sim.c:985:7: warning: passing argument 3 of 'init_disassemble_info'
                    from incompatible pointer type [enabled by default]
include/dis-asm.h:368:13: note: expected 'fprintf_ftype' but argument is
of type 'int (*)(struct FILE * __restrict__,  const char * __restrict__)'

sim/msp430/ChangeLog
sim/msp430/msp430-sim.c

index a5c5fec2589316f6def345f8415c12b0f772ab11..0a3da7dc491a7189d2f1d2515d20ac0b7a4694f0 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-10  Mike Frysinger  <vapier@gentoo.org>
+
+       * msp430-sim (maybe_perform_syscall): Change %d to %ld.
+       (msp430_step_once): Cast fprintf to fprintf_ftype.
+
 2013-09-23  Alan Modra  <amodra@gmail.com>
 
        * aclocal.m4, configure: Regenerate.
index 8cd2e1e1448439352f84446cdd7e3259ec44cec0..c3fa4a9621bc22a5408240d4191e03ec0c63da84 100644 (file)
@@ -895,7 +895,7 @@ maybe_perform_syscall (SIM_DESC sd, int call_addr)
 
       if (TRACE_SYSCALL_P (MSP430_CPU (sd)))
        trace_generic (sd, MSP430_CPU (sd), TRACE_SYSCALL_IDX,
-                      "returns %d", sc.result);
+                      "returns %ld", sc.result);
 
       MSP430_CPU (sd)->state.regs[12] = sc.result;
       return 1;
@@ -982,7 +982,7 @@ msp430_step_once (SIM_DESC sd)
 
       sim_core_read_buffer (sd, MSP430_CPU (sd), 0, b, opcode_pc, opsize);
 
-      init_disassemble_info (&info, stderr, fprintf);
+      init_disassemble_info (&info, stderr, (fprintf_ftype) fprintf);
       info.private_data = sd;
       info.read_memory_func = msp430_dis_read;
       fprintf (stderr, "%#8x  ", opcode_pc);