• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisão269e9c185f67d477a99574f53ead904d50fddfda (tree)
Hora2015-04-01 15:22:58
AutorMike Frysinger <vapier@gent...>
CommiterMike Frysinger

Mensagem de Log

sim: m32c: enable warnings & clean up a bunch

This doesn't clean up all the warnings, just most of them.
The ones that are left will require some care to unravel.

Mudança Sumário

Diff

--- a/sim/m32c/ChangeLog
+++ b/sim/m32c/ChangeLog
@@ -1,3 +1,39 @@
1+2015-04-01 Mike Frysinger <vapier@gentoo.org>
2+
3+ * configure.ac: Call SIM_AC_OPTION_WARNINGS.
4+ * configure: Regenerate.
5+ * cpu.h (decode_opcode, decode_r8c, decode_m32c,
6+ trace_register_changes): Convert old style prototypes.
7+ (m32c_dump_all_registers): New prototype.
8+ * gdb-if.c: Include stdlib.h.
9+ (sim_info): Delete.
10+ (siggnal, handle_step): Mark static.
11+ (sim_resume): Move rc decl to top of scope.
12+ * load.c: Include load.h.
13+ (decode_opcode); Convert old style prototype.
14+ (m32c_load): Move base decl to top of scope.
15+ * load.h (m32c_set_mach): Change mach type to unsigned long.
16+ * m32c.opc (getbyte, decode_m32c): Convert old style prototypes.
17+ (prefix): Convert old style prototype and mark static.
18+ * mem.c (mem_ptr, mem_usage_stats, e, mem_get_pc, stdin_ready,
19+ m32c_sim_restore_console, update_timer_a): Convert old style
20+ prototypes.
21+ (mem_put_byte): Mark static.
22+ * mem.h (mem_get_pc, m32c_sim_restore_console): Convert old style
23+ prototypes.
24+ * r8c.opc (getbyte, IMM, decode_r8c): Convert old style prototypes.
25+ * reg.c (stack_heap_stats, trace_register_changes,
26+ m32c_dump_all_registers): Convert old style prototypes.
27+ (put_reg): Move b decl to top of scope.
28+ * sample2.c (start): Convert old style prototype.
29+ * srcdest.c (disp8, disp16, disp24, disp20): Convert old style
30+ prototypes.
31+ (decode_srcdest4, decode_jumpdest): Move sd init below decls.
32+ * timer_a.h (update_timer_a): Convert old style prototype.
33+ * trace.c: Include trace.h.
34+ (load_file_and_line): Move file decl to top of scope.
35+ (sim_disasm_one): Convert old style prototype.
36+
137 2015-03-31 Mike Frysinger <vapier@gentoo.org>
238
339 * config.in, configure: Regenerate.
--- a/sim/m32c/configure
+++ b/sim/m32c/configure
@@ -761,6 +761,9 @@ enable_sim_trace
761761 enable_sim_profile
762762 with_pkgversion
763763 with_bugurl
764+enable_werror
765+enable_build_warnings
766+enable_sim_build_warnings
764767 '
765768 ac_precious_vars='build_alias
766769 host_alias
@@ -1403,6 +1406,11 @@ Optional Features:
14031406 --enable-sim-stdio Specify whether to use stdio for console input/output.
14041407 --enable-sim-trace=opts Enable tracing flags
14051408 --enable-sim-profile=opts Enable profiling flags
1409+ --enable-werror treat compile warnings as errors
1410+ --enable-build-warnings enable build-time compiler warnings if gcc is used
1411+ --enable-sim-build-warnings
1412+ enable SIM specific build-time compiler warnings if
1413+ gcc is used
14061414
14071415 Optional Packages:
14081416 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -12286,7 +12294,7 @@ else
1228612294 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1228712295 lt_status=$lt_dlunknown
1228812296 cat > conftest.$ac_ext <<_LT_EOF
12289-#line 12289 "configure"
12297+#line 12297 "configure"
1229012298 #include "confdefs.h"
1229112299
1229212300 #if HAVE_DLFCN_H
@@ -12392,7 +12400,7 @@ else
1239212400 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1239312401 lt_status=$lt_dlunknown
1239412402 cat > conftest.$ac_ext <<_LT_EOF
12395-#line 12395 "configure"
12403+#line 12403 "configure"
1239612404 #include "confdefs.h"
1239712405
1239812406 #if HAVE_DLFCN_H
@@ -12882,6 +12890,109 @@ sim_link_links="${sim_link_links} targ-vals.def"
1288212890
1288312891
1288412892
12893+
12894+# Check whether --enable-werror was given.
12895+if test "${enable_werror+set}" = set; then :
12896+ enableval=$enable_werror; case "${enableval}" in
12897+ yes | y) ERROR_ON_WARNING="yes" ;;
12898+ no | n) ERROR_ON_WARNING="no" ;;
12899+ *) as_fn_error "bad value ${enableval} for --enable-werror" "$LINENO" 5 ;;
12900+ esac
12901+fi
12902+
12903+
12904+# Enable -Werror by default when using gcc
12905+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
12906+ ERROR_ON_WARNING=yes
12907+fi
12908+
12909+WERROR_CFLAGS=""
12910+if test "${ERROR_ON_WARNING}" = yes ; then
12911+# NOTE: Disabled in the sim dir due to most sims generating warnings.
12912+# WERROR_CFLAGS="-Werror"
12913+ true
12914+fi
12915+
12916+build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
12917+-Wpointer-sign \
12918+-Wno-unused -Wunused-value -Wunused-function \
12919+-Wno-switch -Wno-char-subscripts -Wmissing-prototypes
12920+-Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \
12921+-Wold-style-declaration -Wold-style-definition"
12922+
12923+# Enable -Wno-format by default when using gcc on mingw since many
12924+# GCC versions complain about %I64.
12925+case "${host}" in
12926+ *-*-mingw32*) build_warnings="$build_warnings -Wno-format" ;;
12927+ *) build_warnings="$build_warnings -Wformat-nonliteral" ;;
12928+esac
12929+
12930+# Check whether --enable-build-warnings was given.
12931+if test "${enable_build_warnings+set}" = set; then :
12932+ enableval=$enable_build_warnings; case "${enableval}" in
12933+ yes) ;;
12934+ no) build_warnings="-w";;
12935+ ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
12936+ build_warnings="${build_warnings} ${t}";;
12937+ *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
12938+ build_warnings="${t} ${build_warnings}";;
12939+ *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
12940+esac
12941+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
12942+ echo "Setting compiler warning flags = $build_warnings" 6>&1
12943+fi
12944+fi
12945+# Check whether --enable-sim-build-warnings was given.
12946+if test "${enable_sim_build_warnings+set}" = set; then :
12947+ enableval=$enable_sim_build_warnings; case "${enableval}" in
12948+ yes) ;;
12949+ no) build_warnings="-w";;
12950+ ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
12951+ build_warnings="${build_warnings} ${t}";;
12952+ *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
12953+ build_warnings="${t} ${build_warnings}";;
12954+ *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
12955+esac
12956+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
12957+ echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1
12958+fi
12959+fi
12960+WARN_CFLAGS=""
12961+if test "x${build_warnings}" != x -a "x$GCC" = xyes
12962+then
12963+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler warning flags" >&5
12964+$as_echo_n "checking compiler warning flags... " >&6; }
12965+ # Separate out the -Werror flag as some files just cannot be
12966+ # compiled with it enabled.
12967+ for w in ${build_warnings}; do
12968+ case $w in
12969+ -Werr*) WERROR_CFLAGS=-Werror ;;
12970+ *) # Check that GCC accepts it
12971+ saved_CFLAGS="$CFLAGS"
12972+ CFLAGS="$CFLAGS $w"
12973+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12974+/* end confdefs.h. */
12975+
12976+int
12977+main ()
12978+{
12979+
12980+ ;
12981+ return 0;
12982+}
12983+_ACEOF
12984+if ac_fn_c_try_compile "$LINENO"; then :
12985+ WARN_CFLAGS="${WARN_CFLAGS} $w"
12986+fi
12987+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12988+ CFLAGS="$saved_CFLAGS"
12989+ esac
12990+ done
12991+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WARN_CFLAGS} ${WERROR_CFLAGS}" >&5
12992+$as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; }
12993+fi
12994+
12995+
1288512996 for ac_header in sys/select.h termios.h sys/socket.h netinet/in.h netinet/tcp.h
1288612997 do :
1288712998 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
--- a/sim/m32c/configure.ac
+++ b/sim/m32c/configure.ac
@@ -24,6 +24,8 @@ sinclude(../common/acinclude.m4)
2424
2525 SIM_AC_COMMON
2626
27+SIM_AC_OPTION_WARNINGS
28+
2729 AC_CHECK_HEADERS(sys/select.h termios.h sys/socket.h netinet/in.h netinet/tcp.h)
2830
2931 SIM_AC_OUTPUT
--- a/sim/m32c/cpu.h
+++ b/sim/m32c/cpu.h
@@ -220,9 +220,11 @@ extern unsigned int heaptop;
220220 extern unsigned int heapbottom;
221221
222222 /* Points to one of the below functions, set by m32c_load(). */
223-extern int (*decode_opcode) ();
223+extern int (*decode_opcode) (void);
224224
225-extern int decode_r8c ();
226-extern int decode_m32c ();
225+extern int decode_r8c (void);
226+extern int decode_m32c (void);
227227
228-extern void trace_register_changes ();
228+extern void trace_register_changes (void);
229+
230+extern void m32c_dump_all_registers (void);
--- a/sim/m32c/gdb-if.c
+++ b/sim/m32c/gdb-if.c
@@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
2222 #include <stdio.h>
2323 #include <assert.h>
2424 #include <signal.h>
25+#include <stdlib.h>
2526 #include <string.h>
2627 #include <ctype.h>
2728
@@ -509,22 +510,14 @@ sim_store_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
509510 return size;
510511 }
511512
512-void
513-sim_info (SIM_DESC sd, int verbose)
514-{
515- check_desc (sd);
516-
517- printf ("The m32c minisim doesn't collect any statistics.\n");
518-}
519-
520513 static volatile int stop;
521514 static enum sim_stop reason;
522-int siggnal;
515+static int siggnal;
523516
524517
525518 /* Given a signal number used by the M32C bsp (that is, newlib),
526519 return a target signal number used by GDB. */
527-int
520+static int
528521 m32c_signal_to_target (int m32c)
529522 {
530523 switch (m32c)
@@ -560,7 +553,7 @@ m32c_signal_to_target (int m32c)
560553
561554 /* Take a step return code RC and set up the variables consulted by
562555 sim_stop_reason appropriately. */
563-void
556+static void
564557 handle_step (int rc)
565558 {
566559 if (M32C_STEPPED (rc) || M32C_HIT_BREAK (rc))
@@ -609,6 +602,8 @@ sim_resume (SIM_DESC sd, int step, int sig_to_deliver)
609602 interrupt signal handler. */
610603 for (;;)
611604 {
605+ int rc;
606+
612607 if (stop)
613608 {
614609 stop = 0;
@@ -617,7 +612,7 @@ sim_resume (SIM_DESC sd, int step, int sig_to_deliver)
617612 break;
618613 }
619614
620- int rc = decode_opcode ();
615+ rc = decode_opcode ();
621616 #ifdef TIMER_A
622617 update_timer_a ();
623618 #endif
--- a/sim/m32c/load.c
+++ b/sim/m32c/load.c
@@ -27,8 +27,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
2727
2828 #include "cpu.h"
2929 #include "mem.h"
30+#include "load.h"
3031
31-int (*decode_opcode) () = 0;
32+int (*decode_opcode) (void) = 0;
3233 int default_machine = 0;
3334
3435 void
@@ -88,12 +89,13 @@ m32c_load (bfd * prog)
8889 {
8990 char *buf;
9091 bfd_size_type size;
92+ bfd_vma base;
9193
9294 size = bfd_get_section_size (s);
9395 if (size <= 0)
9496 continue;
9597
96- bfd_vma base = bfd_section_lma (prog, s);
98+ base = bfd_section_lma (prog, s);
9799 if (verbose)
98100 fprintf (stderr, "[load a=%08x s=%08x %s]\n",
99101 (int) base, (int) size, bfd_get_section_name (prog, s));
--- a/sim/m32c/load.h
+++ b/sim/m32c/load.h
@@ -23,5 +23,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
2323
2424 extern int default_machine;
2525
26-void m32c_set_mach (int mach);
26+void m32c_set_mach (unsigned long mach);
2727 void m32c_load (bfd *);
--- a/sim/m32c/m32c.opc
+++ b/sim/m32c/m32c.opc
@@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
3232 #define tprintf if (trace) printf
3333
3434 static unsigned char
35-getbyte ()
35+getbyte (void)
3636 {
3737 int tsave = trace;
3838 unsigned char b;
@@ -105,8 +105,8 @@ IMM(int bytes)
105105
106106 /* Indicate which sorts of prefixes are allowed for the current
107107 opcode. */
108-void
109-prefix (src_allowed, dest_allowed, index_bytewidth)
108+static void
109+prefix (int src_allowed, int dest_allowed, int index_bytewidth)
110110 {
111111 /* At the moment, we don't do anything with this information. We
112112 just wanted to get the information entered in some
@@ -394,7 +394,7 @@ static int pcs[16];
394394 static int ipcs = 0;
395395
396396 int
397-decode_m32c()
397+decode_m32c (void)
398398 {
399399 unsigned char op[40];
400400 int opi;
--- a/sim/m32c/mem.c
+++ b/sim/m32c/mem.c
@@ -89,7 +89,7 @@ init_mem (void)
8989 }
9090
9191 static unsigned char *
92-mem_ptr (address)
92+mem_ptr (int address)
9393 {
9494 static int recursing = 0;
9595 int pt1 = (address >> (L2_BITS + OFF_BITS)) & ((1 << L1_BITS) - 1);
@@ -139,7 +139,7 @@ mcs (int isput, int bytes)
139139 }
140140
141141 void
142-mem_usage_stats ()
142+mem_usage_stats (void)
143143 {
144144 int i, j;
145145 int rstart = 0;
@@ -192,7 +192,7 @@ s (int address, char *dir)
192192
193193 #define S(d) if (trace) s(address, d)
194194 static void
195-e ()
195+e (void)
196196 {
197197 if (!trace)
198198 return;
@@ -205,7 +205,7 @@ e ()
205205
206206 extern int m32c_disassemble;
207207
208-void
208+static void
209209 mem_put_byte (int address, unsigned char value)
210210 {
211211 unsigned char *m;
@@ -376,7 +376,7 @@ mem_put_blk (int address, const void *bufptr, int nbytes)
376376 }
377377
378378 unsigned char
379-mem_get_pc ()
379+mem_get_pc (void)
380380 {
381381 unsigned char *m = mem_ptr (regs.r_pc & membus_mask);
382382 COUNT (0, 0);
@@ -388,7 +388,7 @@ static int console_raw = 0;
388388 static struct termios oattr;
389389
390390 static int
391-stdin_ready ()
391+stdin_ready (void)
392392 {
393393 fd_set ifd;
394394 int n;
@@ -403,7 +403,7 @@ stdin_ready ()
403403 }
404404
405405 void
406-m32c_sim_restore_console ()
406+m32c_sim_restore_console (void)
407407 {
408408 if (console_raw)
409409 tcsetattr (m32c_console_ifd, TCSANOW, &oattr);
@@ -557,7 +557,7 @@ sign_ext (int v, int bits)
557557
558558 #if TIMER_A
559559 void
560-update_timer_a ()
560+update_timer_a (void)
561561 {
562562 if (timer_a.bsr & 1)
563563 {
--- a/sim/m32c/mem.h
+++ b/sim/m32c/mem.h
@@ -29,7 +29,7 @@ void mem_put_si (int address, unsigned long value);
2929
3030 void mem_put_blk (int address, const void *bufptr, int nbytes);
3131
32-unsigned char mem_get_pc ();
32+unsigned char mem_get_pc (void);
3333
3434 unsigned char mem_get_qi (int address);
3535 unsigned short mem_get_hi (int address);
@@ -40,6 +40,6 @@ void mem_get_blk (int address, void *bufptr, int nbytes);
4040
4141 int sign_ext (int v, int bits);
4242
43-void m32c_sim_restore_console ();
43+void m32c_sim_restore_console (void);
4444
4545 extern int m32c_use_raw_console;
--- a/sim/m32c/r8c.opc
+++ b/sim/m32c/r8c.opc
@@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
3232 #define tprintf if (trace) printf
3333
3434 static unsigned char
35-getbyte ()
35+getbyte (void)
3636 {
3737 int tsave = trace;
3838 unsigned char b;
@@ -77,7 +77,7 @@ unsupported (char *tag, int orig_pc)
7777 }
7878
7979 static int
80-IMM(bw)
80+IMM (int bw)
8181 {
8282 int rv = getbyte ();
8383 if (bw)
@@ -306,7 +306,7 @@ static int bmcnd_cond_map[] = {
306306 };
307307
308308 int
309-decode_r8c()
309+decode_r8c (void)
310310 {
311311 unsigned char op[40];
312312 int opi = 0;
--- a/sim/m32c/reg.c
+++ b/sim/m32c/reg.c
@@ -219,7 +219,7 @@ get_reg_ll (reg_id id)
219219 static int highest_sp = 0, lowest_sp = 0xffffff;
220220
221221 void
222-stack_heap_stats ()
222+stack_heap_stats (void)
223223 {
224224 printf ("heap: %08x - %08x (%d bytes)\n", heapbottom, heaptop,
225225 heaptop - heapbottom);
@@ -230,10 +230,11 @@ stack_heap_stats ()
230230 void
231231 put_reg (reg_id id, unsigned int v)
232232 {
233+ reg_bank_type *b = regs.r + (FLAG_B ? 1 : 0);
234+
233235 if (trace > ((id != pc) ? 0 : 1))
234236 printf ("put_reg (%s) = %0*x\n", reg_names[id], reg_bytes[id] * 2, v);
235237
236- reg_bank_type *b = regs.r + (FLAG_B ? 1 : 0);
237238 switch (id)
238239 {
239240 case r0:
@@ -605,7 +606,7 @@ print_flags (int f)
605606 }
606607
607608 void
608-trace_register_changes ()
609+trace_register_changes (void)
609610 {
610611 if (!trace)
611612 return;
@@ -646,7 +647,7 @@ trace_register_changes ()
646647 reg_bytes[id]*2, (unsigned int)regs.f); \
647648
648649 void
649-m32c_dump_all_registers ()
650+m32c_dump_all_registers (void)
650651 {
651652 printf ("\033[36mREGS:");
652653 DRC (r[0].r_r0, "r0", r0);
--- a/sim/m32c/sample2.c
+++ b/sim/m32c/sample2.c
@@ -21,7 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
2121 /* See the 'sample2.x' target in Makefile.in. */
2222 void exit (int);
2323
24-start ()
24+void
25+start (void)
2526 {
2627 foo (1, 2, 3, 4);
2728 exit (5);
--- a/sim/m32c/srcdest.c
+++ b/sim/m32c/srcdest.c
@@ -31,7 +31,7 @@ static int src_addend = 0;
3131 static int dest_addend = 0;
3232
3333 static int
34-disp8 ()
34+disp8 (void)
3535 {
3636 int rv;
3737 int tsave = trace;
@@ -45,7 +45,7 @@ disp8 ()
4545 }
4646
4747 static int
48-disp16 ()
48+disp16 (void)
4949 {
5050 int rv;
5151 int tsave = trace;
@@ -59,7 +59,7 @@ disp16 ()
5959 }
6060
6161 static int
62-disp24 ()
62+disp24 (void)
6363 {
6464 int rv;
6565 int tsave = trace;
@@ -73,7 +73,7 @@ disp24 ()
7373 }
7474
7575 static int
76-disp20 ()
76+disp20 (void)
7777 {
7878 return disp24 () & 0x000fffff;
7979 }
@@ -117,8 +117,6 @@ srcdest
117117 decode_srcdest4 (int destcode, int bw)
118118 {
119119 srcdest sd;
120- sd.bytes = bw ? 2 : 1;
121- sd.mem = (destcode >= 6) ? 1 : 0;
122120 static const char *dc_wnames[16] = { "r0", "r1", "r2", "r3",
123121 "a0", "a1", "[a0]", "[a1]",
124122 "disp8[a0]", "disp8[a1]", "disp8[sb]", "disp8[fb]",
@@ -126,6 +124,9 @@ decode_srcdest4 (int destcode, int bw)
126124 };
127125 static const char *dc_bnames[4] = { "r0l", "r0h", "r1l", "r1h" };;
128126
127+ sd.bytes = bw ? 2 : 1;
128+ sd.mem = (destcode >= 6) ? 1 : 0;
129+
129130 if (trace)
130131 {
131132 const char *n = dc_wnames[destcode];
@@ -199,8 +200,6 @@ srcdest
199200 decode_jumpdest (int destcode, int w)
200201 {
201202 srcdest sd;
202- sd.bytes = w ? 2 : 3;
203- sd.mem = (destcode >= 6) ? 1 : 0;
204203 static const char *dc_wnames[16] = { "r0", "r1", "r2", "r3",
205204 "a0", "a1", "[a0]", "[a1]",
206205 "disp8[a0]", "disp8[a1]", "disp8[sb]", "disp8[fb]",
@@ -208,6 +207,9 @@ decode_jumpdest (int destcode, int w)
208207 };
209208 static const char *dc_anames[4] = { "r0l", "r0h", "r1l", "r1h" };
210209
210+ sd.bytes = w ? 2 : 3;
211+ sd.mem = (destcode >= 6) ? 1 : 0;
212+
211213 if (trace)
212214 {
213215 const char *n = dc_wnames[destcode];
--- a/sim/m32c/timer_a.h
+++ b/sim/m32c/timer_a.h
@@ -11,4 +11,4 @@ typedef struct
1111
1212 extern Timer_A timer_a;
1313
14-extern void update_timer_a ();
14+extern void update_timer_a (void);
--- a/sim/m32c/trace.c
+++ b/sim/m32c/trace.c
@@ -34,6 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
3434 #include "cpu.h"
3535 #include "mem.h"
3636 #include "load.h"
37+#include "trace.h"
3738
3839 static int
3940 sim_dis_read (bfd_vma memaddr, bfd_byte * ptr, unsigned int length,
@@ -128,6 +129,7 @@ load_file_and_line (const char *filename, int lineno)
128129 int i;
129130 struct stat s;
130131 const char *found_filename, *slash;
132+ FILE *file;
131133
132134 found_filename = filename;
133135 while (1)
@@ -145,7 +147,7 @@ load_file_and_line (const char *filename, int lineno)
145147 files = f;
146148 f->filename = strdup (filename);
147149 f->data = (char *) malloc (s.st_size + 2);
148- FILE *file = fopen (found_filename, "rb");
150+ file = fopen (found_filename, "rb");
149151 fread (f->data, 1, s.st_size, file);
150152 f->data[s.st_size] = 0;
151153 fclose (file);
@@ -174,7 +176,7 @@ load_file_and_line (const char *filename, int lineno)
174176 }
175177
176178 void
177-sim_disasm_one ()
179+sim_disasm_one (void)
178180 {
179181 static int initted = 0;
180182 static asymbol **symtab = 0;