summaryrefslogtreecommitdiff
path: root/opcodes/tic6x-dis.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-02-03 09:04:21 +0000
committerNick Clifton <nickc@redhat.com>2017-02-03 09:04:21 +0000
commit1b7e3d2fb7036ce6f9d74e32dc052518f5cd45b6 (patch)
treec688cc3b7f56099d9e92a92af400fd1cbccf920b /opcodes/tic6x-dis.c
parent65c40c956fcd9443a5390d6cc36f84bd1bf77df4 (diff)
downloadbinutils-gdb-1b7e3d2fb7036ce6f9d74e32dc052518f5cd45b6.tar.gz
Fix compile time warning messages when compiling binutils with gcc 7.0.1.
PR 21096 bfd * coffcode.h (coff_write_object_contents): Enlarge size of s_name_buf in order to avoid compile time warning about possible integer truncation. * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower 32-bits of insn value before printing into buffer. opcodes * aarch64-opc.c (print_register_list): Ensure that the register list index will fir into the tb buffer. (print_register_offset_address): Likewise. * tic6x-dis.c (print_insn_tic6x): Increase size of func_unit_buf.
Diffstat (limited to 'opcodes/tic6x-dis.c')
-rw-r--r--opcodes/tic6x-dis.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/opcodes/tic6x-dis.c b/opcodes/tic6x-dis.c
index 1a6f5757ce1..48046b2df54 100644
--- a/opcodes/tic6x-dis.c
+++ b/opcodes/tic6x-dis.c
@@ -316,7 +316,7 @@ print_insn_tic6x (bfd_vma addr, struct disassemble_info *info)
const char *parallel;
const char *cond = "";
const char *func_unit;
- char func_unit_buf[7];
+ char func_unit_buf[8];
unsigned int func_unit_side = 0;
unsigned int func_unit_data_side = 0;
unsigned int func_unit_cross = 0;
@@ -703,8 +703,9 @@ print_insn_tic6x (bfd_vma addr, struct disassemble_info *info)
if (opc->flags & TIC6X_FLAG_INSN16_BSIDE && func_unit_side == 1)
func_unit_cross = 1;
- snprintf (func_unit_buf, 7, " .%c%u%s%s", func_unit_char,
- func_unit_side, (func_unit_cross ? "X" : ""), data_str);
+ snprintf (func_unit_buf, sizeof func_unit_buf, " .%c%u%s%s",
+ func_unit_char, func_unit_side,
+ (func_unit_cross ? "X" : ""), data_str);
func_unit = func_unit_buf;
}