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.
This commit is contained in:
Mike Frysinger
2021-05-08 12:41:04 -04:00
parent b50a658ac1
commit bb608f811b
4 changed files with 21 additions and 8 deletions

View File

@ -1,3 +1,11 @@
2021-05-08 Mike Frysinger <vapier@gentoo.org>
* 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 <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -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.

13
sim/h8300/configure vendored
View File

@ -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"

View File

@ -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)