From bb608f811bcd013cf7f8b8038310f169639f29d5 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 8 May 2021 12:41:04 -0400 Subject: [PATCH] sim: h8300: clean up various warnings A random grab bag of minor fixes to enable -Werror for this port. Disable h8_set_macS for now as it's unused. Initialize trace & intMask before using them. Mark local set_h8300h function static. --- sim/h8300/ChangeLog | 8 ++++++++ sim/h8300/compile.c | 7 +++++-- sim/h8300/configure | 13 ++++++++----- sim/h8300/configure.ac | 1 - 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog index c922aaf73ba..578836eb2ee 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/ChangeLog @@ -1,3 +1,11 @@ +2021-05-08 Mike Frysinger + + * compile.c (h8_set_macS): Disable with #if 0. + (step_once): Set trace & intMask to 0. + (set_h8300h): Mark static. + * configure.ac: Delete SIM_AC_OPTION_WARNINGS call. + * configure: Regenerate. + 2021-05-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index fb0e51b2e58..365f8667c6a 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -307,11 +307,13 @@ h8_get_macS (SIM_DESC sd) return (STATE_CPU (sd, 0)) -> macS; } +#if 0 static void h8_set_macS (SIM_DESC sd, int val) { (STATE_CPU (sd, 0)) -> macS = (val != 0); } +#endif /* MAC Zero Flag */ static int @@ -1716,7 +1718,8 @@ step_once (SIM_DESC sd, SIM_CPU *cpu) int bit; int pc; int c, nz, v, n, u, h, ui, intMaskBit; - int trace, intMask; + int trace = 0; + int intMask = 0; int oldmask; host_callback *sim_callback = STATE_CALLBACK (sd); @@ -4552,7 +4555,7 @@ sim_info (SIM_DESC sd, int verbose) /* Indicate whether the cpu is an H8/300 or H8/300H. FLAG is non-zero for the H8/300H. */ -void +static void set_h8300h (unsigned long machine) { /* FIXME: Much of the code in sim_load can be moved to sim_open. diff --git a/sim/h8300/configure b/sim/h8300/configure index 2627483afbb..4849a066e53 100755 --- a/sim/h8300/configure +++ b/sim/h8300/configure @@ -11944,6 +11944,11 @@ fi fi + + + + + # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : enableval=$enable_werror; case "${enableval}" in @@ -11960,6 +11965,9 @@ if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then fi WERROR_CFLAGS="" + if test "${ERROR_ON_WARNING}" = yes ; then + WERROR_CFLAGS="-Werror" + fi build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ -Wpointer-sign \ @@ -12041,11 +12049,6 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } fi - - - - - hardware="cfi core pal glue " sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" diff --git a/sim/h8300/configure.ac b/sim/h8300/configure.ac index 8dc33c4cf3a..dc24462742d 100644 --- a/sim/h8300/configure.ac +++ b/sim/h8300/configure.ac @@ -6,7 +6,6 @@ SIM_AC_COMMON SIM_AC_OPTION_ENDIAN(BIG) SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT) -SIM_AC_OPTION_WARNINGS(no) AC_CHECK_HEADERS_ONCE(sys/param.h) -- 2.39.2