]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: h8300: clean up various warnings
authorMike Frysinger <vapier@gentoo.org>
Sat, 8 May 2021 16:41:04 +0000 (12:41 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sat, 8 May 2021 16:43:06 +0000 (12:43 -0400)
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
sim/h8300/compile.c
sim/h8300/configure
sim/h8300/configure.ac

index c922aaf73ba934db6f18313b721291ecc8156c3a..578836eb2ee4ffb1aeccf5137bb9247af1fbe397 100644 (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.
index fb0e51b2e58d381c26296fae805dff3fca1bed7a..365f8667c6a573795d2a78a3e56afa63ca83c345 100644 (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.
index 2627483afbb36647815c6c754e4c4826bb7ad6b8..4849a066e53b2cd29aadcf866c3825a5911af8be 100755 (executable)
 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"
index 8dc33c4cf3ab0a79e60af8ce291167c1d55d98dd..dc24462742dc272befe4081c3b845612cfdd708a 100644 (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)