修訂 | feab6abfe23b5b1724cb3c00059254e8f1bc5225 (tree) |
---|---|
時間 | 2022-10-19 22:32:22 |
作者 | Andrew Burgess <aburgess@redh...> |
Commiter | Andrew Burgess |
sim/iq2000: silence pointer-sign warnings
When building the iq2000 simulator I see a few warnings like this:
I've silenced these warnings by casting buf to 'unsigned char *'.
With this change I now see no warnings when compiling iq2000.c, so
I've removed the line from Makefile.in that disables -Werror.
Makefile.in was also disabling -Werror when compiling mloop.c,
however, I'm not seeing any warnings when compiling that file, so I've
removed the -Werror disable in that case too.
@@ -37,9 +37,6 @@ ALL_CPU_CFLAGS = -DHAVE_CPU_IQ2000BF -DHAVE_CPU_IQ10BF | ||
37 | 37 | |
38 | 38 | SIM_EXTRA_CLEAN = iq2000-clean |
39 | 39 | |
40 | -# Some modules don't build cleanly yet. | |
41 | -iq2000.o mloop.o: SIM_WERROR_CFLAGS = | |
42 | - | |
43 | 40 | ## COMMON_POST_CONFIG_FRAG |
44 | 41 | |
45 | 42 | arch = iq2000 |
@@ -47,7 +47,8 @@ fetch_str (SIM_CPU *current_cpu, PCADDR pc, DI addr) | ||
47 | 47 | pc, read_map, CPU2DATA(addr + nr)) != 0) |
48 | 48 | nr++; |
49 | 49 | buf = NZALLOC (char, nr + 1); |
50 | - sim_read (CPU_STATE (current_cpu), CPU2DATA(addr), buf, nr); | |
50 | + sim_read (CPU_STATE (current_cpu), CPU2DATA(addr), (unsigned char *) buf, | |
51 | + nr); | |
51 | 52 | return buf; |
52 | 53 | } |
53 | 54 |
@@ -82,7 +83,8 @@ do_syscall (SIM_CPU *current_cpu, PCADDR pc) | ||
82 | 83 | |
83 | 84 | case TARGET_NEWLIB_SYS_write: |
84 | 85 | buf = zalloc (PARM3); |
85 | - sim_read (CPU_STATE (current_cpu), CPU2DATA(PARM2), buf, PARM3); | |
86 | + sim_read (CPU_STATE (current_cpu), CPU2DATA(PARM2), | |
87 | + (unsigned char *) buf, PARM3); | |
86 | 88 | SET_H_GR (ret_reg, |
87 | 89 | sim_io_write (CPU_STATE (current_cpu), |
88 | 90 | PARM1, buf, PARM3)); |
@@ -105,7 +107,8 @@ do_syscall (SIM_CPU *current_cpu, PCADDR pc) | ||
105 | 107 | SET_H_GR (ret_reg, |
106 | 108 | sim_io_read (CPU_STATE (current_cpu), |
107 | 109 | PARM1, buf, PARM3)); |
108 | - sim_write (CPU_STATE (current_cpu), CPU2DATA(PARM2), buf, PARM3); | |
110 | + sim_write (CPU_STATE (current_cpu), CPU2DATA(PARM2), | |
111 | + (unsigned char *) buf, PARM3); | |
109 | 112 | free (buf); |
110 | 113 | break; |
111 | 114 |