aboutsummaryrefslogtreecommitdiff
path: root/sim/m68hc11
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-04-29 16:02:02 +0100
committerNick Clifton <nickc@redhat.com>2015-04-29 16:02:02 +0100
commit0a13382c8e708fd9eb15dbc81cedc35e6670090c (patch)
tree9fd21d2d6d7d18ce08e5c4d1f74cf91f57fb631a /sim/m68hc11
parent998d2a3ef31378d3d980972dc68f4926b720a7e9 (diff)
downloadgdb-0a13382c8e708fd9eb15dbc81cedc35e6670090c.zip
gdb-0a13382c8e708fd9eb15dbc81cedc35e6670090c.tar.gz
gdb-0a13382c8e708fd9eb15dbc81cedc35e6670090c.tar.bz2
Fix problems in the sim sources discovered by running the cppcheck static analysis tool.
erc32 PR 18273 * sis.c (main): Remove unreachable code. m68hc11 * gencode.c (gen_fetch_operands): Remove unreachable code. ppc * hw_htab.c (htab_map_binary): Fix overlap check. common * sim-fpu.c (INLINE_SIM_FPU): Fix static analysis warning by increasing parenthesis around casts to signed values.
Diffstat (limited to 'sim/m68hc11')
-rw-r--r--sim/m68hc11/ChangeLog5
-rw-r--r--sim/m68hc11/gencode.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog
index 957abb5..f87aedf 100644
--- a/sim/m68hc11/ChangeLog
+++ b/sim/m68hc11/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-29 Nick Clifton <nickc@redhat.com>
+
+ PR 18273
+ * gencode.c (gen_fetch_operands): Remove unreachable code.
+
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
diff --git a/sim/m68hc11/gencode.c b/sim/m68hc11/gencode.c
index dd9aa5f..ffc285c 100644
--- a/sim/m68hc11/gencode.c
+++ b/sim/m68hc11/gencode.c
@@ -1466,6 +1466,8 @@ gen_fetch_operands (FILE *fp, int col,
vars[cur_var], operand_size, operand_size);
operands += 1;
}
+#if 0 /* This code is never executed (see strncmp above), but it has not been
+ removed because it may be that there is a typo in strncmp test below. */
else if (strncmp (operands, "]", 1) == 0)
{
current_insn_size += 1;
@@ -1473,6 +1475,7 @@ gen_fetch_operands (FILE *fp, int col,
vars[cur_var], operand_size, operand_size);
operands += 1;
}
+#endif
else
{
fatal_error (opcode, "Unknown operand");