From 137f2437e04f733cae1120d032c7a1b24aef54af Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 18 Feb 2009 17:13:04 +0000 Subject: [PATCH] * fr30-opc.c: Regenerate. * frv-opc.c: Regenerate. * ip2k-opc.c: Regenerate. * iq2000-opc.c: Regenerate. * lm32-opc.c: Regenerate. * m32c-opc.c: Regenerate. * m32r-opc.c: Regenerate. * mep-opc.c: Regenerate. * mt-opc.c: Regenerate. * xc16x-opc.c: Regenerate. * xstormy16-opc.c: Regenerate. * tic54x-dis.c (print_instruction): Avoid compiler warning on sprintf call. * opc-itab.scm (<>_cgen_init_opcode_table): Avoid compiler warning about calling memset with a zero length. --- opcodes/ChangeLog | 16 ++++++++++++++++ opcodes/fr30-opc.c | 5 ++++- opcodes/frv-opc.c | 5 ++++- opcodes/ip2k-opc.c | 5 ++++- opcodes/iq2000-opc.c | 5 ++++- opcodes/lm32-opc.c | 5 ++++- opcodes/m32c-opc.c | 5 ++++- opcodes/m32r-opc.c | 5 ++++- opcodes/mep-opc.c | 5 ++++- opcodes/mt-opc.c | 5 ++++- opcodes/tic54x-dis.c | 5 ++++- opcodes/xc16x-opc.c | 5 ++++- opcodes/xstormy16-opc.c | 5 ++++- 13 files changed, 64 insertions(+), 12 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 4332d4dbee5..941aff1ac65 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,19 @@ +2009-02-18 Pierre Muller + + * fr30-opc.c: Regenerate. + * frv-opc.c: Regenerate. + * ip2k-opc.c: Regenerate. + * iq2000-opc.c: Regenerate. + * lm32-opc.c: Regenerate. + * m32c-opc.c: Regenerate. + * m32r-opc.c: Regenerate. + * mep-opc.c: Regenerate. + * mt-opc.c: Regenerate. + * xc16x-opc.c: Regenerate. + * xstormy16-opc.c: Regenerate. + * tic54x-dis.c (print_instruction): Avoid compiler warning on + sprintf call. + 2009-02-12 Nathan Sidwell * m68k-opc.c (m68k_opcodes): Add stldsr instruction. diff --git a/opcodes/fr30-opc.c b/opcodes/fr30-opc.c index ca80aaadacb..6d99258e09b 100644 --- a/opcodes/fr30-opc.c +++ b/opcodes/fr30-opc.c @@ -1361,7 +1361,10 @@ fr30_cgen_init_opcode_table (CGEN_CPU_DESC cd) const CGEN_OPCODE *oc = & fr30_cgen_macro_insn_opcode_table[0]; CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN)); - memset (insns, 0, num_macros * sizeof (CGEN_INSN)); + /* This test has been added to avoid a warning generated + if memset is called with a third argument of value zero. */ + if (num_macros >= 1) + memset (insns, 0, num_macros * sizeof (CGEN_INSN)); for (i = 0; i < num_macros; ++i) { insns[i].base = &ib[i]; diff --git a/opcodes/frv-opc.c b/opcodes/frv-opc.c index e474a0b006d..f1a20e5572e 100644 --- a/opcodes/frv-opc.c +++ b/opcodes/frv-opc.c @@ -6223,7 +6223,10 @@ frv_cgen_init_opcode_table (CGEN_CPU_DESC cd) const CGEN_OPCODE *oc = & frv_cgen_macro_insn_opcode_table[0]; CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN)); - memset (insns, 0, num_macros * sizeof (CGEN_INSN)); + /* This test has been added to avoid a warning generated + if memset is called with a third argument of value zero. */ + if (num_macros >= 1) + memset (insns, 0, num_macros * sizeof (CGEN_INSN)); for (i = 0; i < num_macros; ++i) { insns[i].base = &ib[i]; diff --git a/opcodes/ip2k-opc.c b/opcodes/ip2k-opc.c index 17a6aba082c..080f5602506 100644 --- a/opcodes/ip2k-opc.c +++ b/opcodes/ip2k-opc.c @@ -892,7 +892,10 @@ ip2k_cgen_init_opcode_table (CGEN_CPU_DESC cd) const CGEN_OPCODE *oc = & ip2k_cgen_macro_insn_opcode_table[0]; CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN)); - memset (insns, 0, num_macros * sizeof (CGEN_INSN)); + /* This test has been added to avoid a warning generated + if memset is called with a third argument of value zero. */ + if (num_macros >= 1) + memset (insns, 0, num_macros * sizeof (CGEN_INSN)); for (i = 0; i < num_macros; ++i) { insns[i].base = &ib[i]; diff --git a/opcodes/iq2000-opc.c b/opcodes/iq2000-opc.c index c829c71811d..7d745f55cba 100644 --- a/opcodes/iq2000-opc.c +++ b/opcodes/iq2000-opc.c @@ -3446,7 +3446,10 @@ iq2000_cgen_init_opcode_table (CGEN_CPU_DESC cd) const CGEN_OPCODE *oc = & iq2000_cgen_macro_insn_opcode_table[0]; CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN)); - memset (insns, 0, num_macros * sizeof (CGEN_INSN)); + /* This test has been added to avoid a warning generated + if memset is called with a third argument of value zero. */ + if (num_macros >= 1) + memset (insns, 0, num_macros * sizeof (CGEN_INSN)); for (i = 0; i < num_macros; ++i) { insns[i].base = &ib[i]; diff --git a/opcodes/lm32-opc.c b/opcodes/lm32-opc.c index 1aee5bfa3f3..febfb8fb3fc 100644 --- a/opcodes/lm32-opc.c +++ b/opcodes/lm32-opc.c @@ -844,7 +844,10 @@ lm32_cgen_init_opcode_table (CGEN_CPU_DESC cd) const CGEN_OPCODE *oc = & lm32_cgen_macro_insn_opcode_table[0]; CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN)); - memset (insns, 0, num_macros * sizeof (CGEN_INSN)); + /* This test has been added to avoid a warning generated + if memset is called with a third argument of value zero. */ + if (num_macros >= 1) + memset (insns, 0, num_macros * sizeof (CGEN_INSN)); for (i = 0; i < num_macros; ++i) { insns[i].base = &ib[i]; diff --git a/opcodes/m32c-opc.c b/opcodes/m32c-opc.c index 9497896a874..ff2a72a7eea 100644 --- a/opcodes/m32c-opc.c +++ b/opcodes/m32c-opc.c @@ -80213,7 +80213,10 @@ m32c_cgen_init_opcode_table (CGEN_CPU_DESC cd) const CGEN_OPCODE *oc = & m32c_cgen_macro_insn_opcode_table[0]; CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN)); - memset (insns, 0, num_macros * sizeof (CGEN_INSN)); + /* This test has been added to avoid a warning generated + if memset is called with a third argument of value zero. */ + if (num_macros >= 1) + memset (insns, 0, num_macros * sizeof (CGEN_INSN)); for (i = 0; i < num_macros; ++i) { insns[i].base = &ib[i]; diff --git a/opcodes/m32r-opc.c b/opcodes/m32r-opc.c index 807cba011ca..3455b1daefa 100644 --- a/opcodes/m32r-opc.c +++ b/opcodes/m32r-opc.c @@ -1797,7 +1797,10 @@ m32r_cgen_init_opcode_table (CGEN_CPU_DESC cd) const CGEN_OPCODE *oc = & m32r_cgen_macro_insn_opcode_table[0]; CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN)); - memset (insns, 0, num_macros * sizeof (CGEN_INSN)); + /* This test has been added to avoid a warning generated + if memset is called with a third argument of value zero. */ + if (num_macros >= 1) + memset (insns, 0, num_macros * sizeof (CGEN_INSN)); for (i = 0; i < num_macros; ++i) { insns[i].base = &ib[i]; diff --git a/opcodes/mep-opc.c b/opcodes/mep-opc.c index fd832b09d21..aa25632b912 100644 --- a/opcodes/mep-opc.c +++ b/opcodes/mep-opc.c @@ -2002,7 +2002,10 @@ mep_cgen_init_opcode_table (CGEN_CPU_DESC cd) const CGEN_OPCODE *oc = & mep_cgen_macro_insn_opcode_table[0]; CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN)); - memset (insns, 0, num_macros * sizeof (CGEN_INSN)); + /* This test has been added to avoid a warning generated + if memset is called with a third argument of value zero. */ + if (num_macros >= 1) + memset (insns, 0, num_macros * sizeof (CGEN_INSN)); for (i = 0; i < num_macros; ++i) { insns[i].base = &ib[i]; diff --git a/opcodes/mt-opc.c b/opcodes/mt-opc.c index f73ca2f7be5..f10d25bd745 100644 --- a/opcodes/mt-opc.c +++ b/opcodes/mt-opc.c @@ -915,7 +915,10 @@ mt_cgen_init_opcode_table (CGEN_CPU_DESC cd) const CGEN_OPCODE *oc = & mt_cgen_macro_insn_opcode_table[0]; CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN)); - memset (insns, 0, num_macros * sizeof (CGEN_INSN)); + /* This test has been added to avoid a warning generated + if memset is called with a third argument of value zero. */ + if (num_macros >= 1) + memset (insns, 0, num_macros * sizeof (CGEN_INSN)); for (i = 0; i < num_macros; ++i) { insns[i].base = &ib[i]; diff --git a/opcodes/tic54x-dis.c b/opcodes/tic54x-dis.c index 0b92f907fc5..0b6e7b479f3 100644 --- a/opcodes/tic54x-dis.c +++ b/opcodes/tic54x-dis.c @@ -380,7 +380,10 @@ print_instruction (info, memaddr, opcode, tm_name, tm_operands, size, ext) case OP_CC3: { const char *code[] = { "eq", "lt", "gt", "neq" }; - sprintf (operand[i], code[CC3 (opcode)]); + + /* Do not use sprintf with only two parameters as a + compiler warning could be generated in such conditions. */ + sprintf (operand[i], "%s", code[CC3 (opcode)]); info->fprintf_func (info->stream, "%s%s", comma, operand[i]); break; } diff --git a/opcodes/xc16x-opc.c b/opcodes/xc16x-opc.c index cc34b0c1d71..394f9a068fa 100644 --- a/opcodes/xc16x-opc.c +++ b/opcodes/xc16x-opc.c @@ -3041,7 +3041,10 @@ xc16x_cgen_init_opcode_table (CGEN_CPU_DESC cd) const CGEN_OPCODE *oc = & xc16x_cgen_macro_insn_opcode_table[0]; CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN)); - memset (insns, 0, num_macros * sizeof (CGEN_INSN)); + /* This test has been added to avoid a warning generated + if memset is called with a third argument of value zero. */ + if (num_macros >= 1) + memset (insns, 0, num_macros * sizeof (CGEN_INSN)); for (i = 0; i < num_macros; ++i) { insns[i].base = &ib[i]; diff --git a/opcodes/xstormy16-opc.c b/opcodes/xstormy16-opc.c index 3ac3c2288fa..54b1d412557 100644 --- a/opcodes/xstormy16-opc.c +++ b/opcodes/xstormy16-opc.c @@ -1165,7 +1165,10 @@ xstormy16_cgen_init_opcode_table (CGEN_CPU_DESC cd) const CGEN_OPCODE *oc = & xstormy16_cgen_macro_insn_opcode_table[0]; CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN)); - memset (insns, 0, num_macros * sizeof (CGEN_INSN)); + /* This test has been added to avoid a warning generated + if memset is called with a third argument of value zero. */ + if (num_macros >= 1) + memset (insns, 0, num_macros * sizeof (CGEN_INSN)); for (i = 0; i < num_macros; ++i) { insns[i].base = &ib[i]; -- 2.30.2