aboutsummaryrefslogtreecommitdiff
path: root/gdb/microblaze-tdep.c
diff options
context:
space:
mode:
authorMichael Eager <eager@eagercon.com>2014-07-23 19:21:42 -0700
committerMichael Eager <eager@eagercon.com>2014-07-23 19:21:42 -0700
commita52b4d3e268c10b84a48572db632d5011018e3ef (patch)
tree599c6bbcde24b361ec71b7701b197a8ecd79b1ad /gdb/microblaze-tdep.c
parent11961ad8055910ed653d1d4ed0a20efeeb9ae717 (diff)
downloadgdb-a52b4d3e268c10b84a48572db632d5011018e3ef.zip
gdb-a52b4d3e268c10b84a48572db632d5011018e3ef.tar.gz
gdb-a52b4d3e268c10b84a48572db632d5011018e3ef.tar.bz2
se typecast 'size_t' on 'reg', not only avoid the related warning, but
also check whether less than zero -- for 'reg' is type 'int', and sizeof (dwarf2_to_reg_map) is less than 0x7fff. It is quoted in gdb_assert(), so need check 'reg' whether less than zero. And the related warning (with '-W'): ../../binutils-gdb/gdb/microblaze-tdep.c:667:3: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] ChangeLog: * microblaze-tdep.c (microblaze_dwarf2_reg_to_regnum): Check whether less tha zero in conditional expression.
Diffstat (limited to 'gdb/microblaze-tdep.c')
-rw-r--r--gdb/microblaze-tdep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
index 7e89241..9bec260 100644
--- a/gdb/microblaze-tdep.c
+++ b/gdb/microblaze-tdep.c
@@ -664,7 +664,7 @@ static int dwarf2_to_reg_map[78] =
static int
microblaze_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg)
{
- gdb_assert (reg < sizeof (dwarf2_to_reg_map));
+ gdb_assert ((size_t) reg < sizeof (dwarf2_to_reg_map));
return dwarf2_to_reg_map[reg];
}