This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch opcodes]: Fix boostrap for --enable-targets=all with gcc 4.8
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: Nick Clifton <nickc at redhat dot com>
- Date: Wed, 10 Oct 2012 17:38:50 +0200
- Subject: [patch opcodes]: Fix boostrap for --enable-targets=all with gcc 4.8
Hi,
this patch fixes new warnings occuring by using gcc 4.8.
ChangeLog
2012-10-10 Kai Tietz
* aarch64-asm.c (aarch64_ins_ldst_reglist): Initialize
value with a default.
(do_special_encoding): Likewise.
(aarch64_ins_ldst_elemlist): Pre-initialize QSsize, and opcodeh2
variables with default.
* arc-dis.c (write_comments_): Don't use strncat due
size of state->commentBuffer pointer isn't predictable.
Tested for x86_64-w64-mingw32, and x86_64-unknown-linux-gnu. Ok for apply?
Regards,
Kai
Index: aarch64-asm.c
===================================================================
RCS file: /cvs/src/src/opcodes/aarch64-asm.c,v
retrieving revision 1.2
diff -p -u -3 -r1.2 aarch64-asm.c
--- aarch64-asm.c 17 Sep 2012 17:43:42 -0000 1.2
+++ aarch64-asm.c 10 Oct 2012 15:32:07 -0000
@@ -146,7 +146,7 @@ aarch64_ins_ldst_reglist (const aarch64_
const aarch64_opnd_info *info, aarch64_insn *code,
const aarch64_inst *inst)
{
- aarch64_insn value;
+ aarch64_insn value = 0;
/* Number of elements in each structure to be loaded/stored. */
unsigned num = get_opcode_dependent_value (inst->opcode);
@@ -215,8 +215,8 @@ aarch64_ins_ldst_elemlist (const aarch64
const aarch64_inst *inst ATTRIBUTE_UNUSED)
{
aarch64_field field = {0, 0};
- aarch64_insn QSsize; /* fields Q:S:size. */
- aarch64_insn opcodeh2; /* opcode<2:1> */
+ aarch64_insn QSsize = 0; /* fields Q:S:size. */
+ aarch64_insn opcodeh2 = 0; /* opcode<2:1> */
assert (info->reglist.has_index);
@@ -452,7 +452,7 @@ const char *
aarch64_ins_ft (const aarch64_operand *self, const aarch64_opnd_info *info,
aarch64_insn *code, const aarch64_inst *inst)
{
- aarch64_insn value;
+ aarch64_insn value = 0;
assert (info->idx == 0);
@@ -834,7 +834,7 @@ static void
do_special_encoding (struct aarch64_inst *inst)
{
int idx;
- aarch64_insn value;
+ aarch64_insn value = 0;
DEBUG_TRACE ("enter with coding 0x%x", (uint32_t) inst->value);
Index: arc-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/arc-dis.c,v
retrieving revision 1.17
diff -p -u -3 -r1.17 arc-dis.c
--- arc-dis.c 18 May 2012 01:59:38 -0000 1.17
+++ arc-dis.c 10 Oct 2012 15:32:07 -0000
@@ -426,8 +426,7 @@ write_comments_(struct arcDisState * sta
strcpy (state->commentBuffer, comment_prefix);
else
strcat (state->commentBuffer, ", ");
- strncat (state->commentBuffer, state->comm[i],
- sizeof (state->commentBuffer));
+ strcat (state->commentBuffer, state->comm[i]);
}
}
}