diff options
author | Alan Modra <amodra@gmail.com> | 2010-06-27 04:07:55 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2010-06-27 04:07:55 +0000 |
commit | c7e2358a8849d7540212543e1a2acbac648cb973 (patch) | |
tree | a882f5a804c7dca6bde423d24e5b13b1a3eeff32 /opcodes | |
parent | 1addfd92eb085db42013c4d45e3df8bf2053cde4 (diff) | |
download | gdb-c7e2358a8849d7540212543e1a2acbac648cb973.zip gdb-c7e2358a8849d7540212543e1a2acbac648cb973.tar.gz gdb-c7e2358a8849d7540212543e1a2acbac648cb973.tar.bz2 |
fix set but unused variable warnings
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 25 | ||||
-rw-r--r-- | opcodes/arc-dis.c | 7 | ||||
-rw-r--r-- | opcodes/bfin-dis.c | 8 | ||||
-rw-r--r-- | opcodes/cgen-asm.in | 58 | ||||
-rw-r--r-- | opcodes/dlx-dis.c | 4 | ||||
-rw-r--r-- | opcodes/fr30-asm.c | 58 | ||||
-rw-r--r-- | opcodes/frv-asm.c | 58 | ||||
-rw-r--r-- | opcodes/h8300-dis.c | 15 | ||||
-rw-r--r-- | opcodes/ip2k-asm.c | 58 | ||||
-rw-r--r-- | opcodes/iq2000-asm.c | 58 | ||||
-rw-r--r-- | opcodes/lm32-asm.c | 58 | ||||
-rw-r--r-- | opcodes/m32c-asm.c | 58 | ||||
-rw-r--r-- | opcodes/m32r-asm.c | 58 | ||||
-rw-r--r-- | opcodes/maxq-dis.c | 13 | ||||
-rw-r--r-- | opcodes/mep-asm.c | 58 | ||||
-rw-r--r-- | opcodes/mep-dis.c | 2 | ||||
-rw-r--r-- | opcodes/msp430-dis.c | 6 | ||||
-rw-r--r-- | opcodes/mt-asm.c | 58 | ||||
-rw-r--r-- | opcodes/openrisc-asm.c | 58 | ||||
-rw-r--r-- | opcodes/sparc-dis.c | 5 | ||||
-rw-r--r-- | opcodes/xc16x-asm.c | 58 | ||||
-rw-r--r-- | opcodes/xstormy16-asm.c | 58 |
22 files changed, 487 insertions, 352 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index fac411a..2761067 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,28 @@ +2010-06-27 Alan Modra <amodra@gmail.com> + + * arc-dis.c (arc_sprintf): Delete set but unused variables. + (decodeInstr): Likewise. + * dlx-dis.c (print_insn_dlx): Likewise. + * h8300-dis.c (bfd_h8_disassemble_init): Likewise. + * maxq-dis.c (check_move, print_insn): Likewise. + * mep-dis.c (mep_examine_ivc2_insns): Likewise. + * msp430-dis.c (msp430_branchinstr): Likewise. + * bfin-dis.c (_print_insn_bfin): Avoid set but unused warning. + * cgen-asm.in (parse_insn_normal, _cgen_assemble_insn): Likewise. + * sparc-dis.c (print_insn_sparc): Likewise. + * fr30-asm.c: Regenerate. + * frv-asm.c: Regenerate. + * ip2k-asm.c: Regenerate. + * iq2000-asm.c: Regenerate. + * lm32-asm.c: Regenerate. + * m32c-asm.c: Regenerate. + * m32r-asm.c: Regenerate. + * mep-asm.c: Regenerate. + * mt-asm.c: Regenerate. + * openrisc-asm.c: Regenerate. + * xc16x-asm.c: Regenerate. + * xstormy16-asm.c: Regenerate. + 2010-06-16 Vincent Rivière <vincent.riviere@freesbee.fr> PR gas/11673 diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c index ba67454..b4cc241 100644 --- a/opcodes/arc-dis.c +++ b/opcodes/arc-dis.c @@ -1,5 +1,5 @@ /* Instruction printing code for the ARC. - Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2005, 2007, 2009 + Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2005, 2007, 2009, 2010 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). @@ -238,7 +238,6 @@ arc_sprintf (struct arcDisState *state, char *buf, const char *format, ...) char *bp; const char *p; int size, leading_zero, regMap[2]; - long auxNum; va_list ap; va_start (ap, format); @@ -246,7 +245,6 @@ arc_sprintf (struct arcDisState *state, char *buf, const char *format, ...) bp = buf; *bp = 0; p = format; - auxNum = -1; regMap[0] = 0; regMap[1] = 0; @@ -1170,7 +1168,6 @@ decodeInstr (bfd_vma address, /* Address of this instruction. */ struct arcDisState s; /* ARC Disassembler state. */ void *stream = info->stream; /* Output stream. */ fprintf_ftype func = info->fprintf_func; - int bytes; memset (&s, 0, sizeof(struct arcDisState)); @@ -1201,7 +1198,7 @@ decodeInstr (bfd_vma address, /* Address of this instruction. */ s.instName = _instName; /* Disassemble. */ - bytes = dsmOneArcInst (address, & s); + dsmOneArcInst (address, & s); /* Display the disassembly instruction. */ (*func) (stream, "%08lx ", s.words[0]); diff --git a/opcodes/bfin-dis.c b/opcodes/bfin-dis.c index 0be89f5..4741d20 100644 --- a/opcodes/bfin-dis.c +++ b/opcodes/bfin-dis.c @@ -1,5 +1,5 @@ /* Disassemble ADI Blackfin Instructions. - Copyright 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of libopcodes. @@ -4629,7 +4629,11 @@ _print_insn_bfin (bfd_vma pc, disassemble_info *outf) int rv = 0; status = (*outf->read_memory_func) (pc & ~0x1, buf, 2, outf); + /* FIXME */ + (void) status; status = (*outf->read_memory_func) ((pc + 2) & ~0x1, buf + 2, 2, outf); + /* FIXME */ + (void) status; iw0 = bfd_getl16 (buf); iw1 = bfd_getl16 (buf + 2); @@ -4729,6 +4733,8 @@ print_insn_bfin (bfd_vma pc, disassemble_info *outf) int count = 0; status = (*outf->read_memory_func) (pc & ~0x01, buf, 2, outf); + /* FIXME */ + (void) status; iw0 = bfd_getl16 (buf); count += _print_insn_bfin (pc, outf); diff --git a/opcodes/cgen-asm.in b/opcodes/cgen-asm.in index 5dde0ae..be34ef5 100644 --- a/opcodes/cgen-asm.in +++ b/opcodes/cgen-asm.in @@ -274,9 +274,11 @@ parse_insn_normal (CGEN_CPU_DESC cd, continue; } +#ifdef CGEN_MNEMONIC_OPERANDS + (void) past_opcode_p; +#endif /* We have an operand of some sort. */ - errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), - &str, fields); + errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); if (errmsg) return errmsg; @@ -393,31 +395,39 @@ const CGEN_INSN * { static char errbuf[150]; -#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS const char *tmp_errmsg; - - /* If requesting verbose error messages, use insert_errmsg. - Failing that, use parse_errmsg. */ - tmp_errmsg = (insert_errmsg ? insert_errmsg : - parse_errmsg ? parse_errmsg : - recognized_mnemonic ? - _("unrecognized form of instruction") : - _("unrecognized instruction")); - - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); - else - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS +#define be_verbose 1 #else - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s...'"), start); - else - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s'"), start); +#define be_verbose 0 #endif + + if (be_verbose) + { + /* If requesting verbose error messages, use insert_errmsg. + Failing that, use parse_errmsg. */ + tmp_errmsg = (insert_errmsg ? insert_errmsg : + parse_errmsg ? parse_errmsg : + recognized_mnemonic ? + _("unrecognized form of instruction") : + _("unrecognized instruction")); + + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); + else + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); + } + else + { + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s...'"), start); + else + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s'"), start); + } *errmsg = errbuf; return NULL; diff --git a/opcodes/dlx-dis.c b/opcodes/dlx-dis.c index 1eb2576..f055c4d 100644 --- a/opcodes/dlx-dis.c +++ b/opcodes/dlx-dis.c @@ -1,5 +1,5 @@ /* Instruction printing code for the DLX Microprocessor - Copyright 2002, 2005, 2007 Free Software Foundation, Inc. + Copyright 2002, 2005, 2007, 2010 Free Software Foundation, Inc. Contributed by Kuang Hwa Lin. Written by Kuang Hwa Lin, 03/2002. This file is part of the GNU opcodes library. @@ -437,7 +437,6 @@ print_insn_dlx (bfd_vma memaddr, struct disassemble_info* info) bfd_byte buffer[4]; int insn_idx; unsigned long insn_word; - unsigned char rtn_code; unsigned long dlx_insn_type[] = { (unsigned long) dlx_r_type, @@ -481,7 +480,6 @@ print_insn_dlx (bfd_vma memaddr, struct disassemble_info* info) #endif /* Scan through all the insn type and print the insn out. */ - rtn_code = 0; current_insn_addr = (unsigned long) memaddr; for (insn_idx = 0; dlx_insn_type[insn_idx] != 0x0; insn_idx++) diff --git a/opcodes/fr30-asm.c b/opcodes/fr30-asm.c index bbb1a86..ad0456e 100644 --- a/opcodes/fr30-asm.c +++ b/opcodes/fr30-asm.c @@ -557,9 +557,11 @@ parse_insn_normal (CGEN_CPU_DESC cd, continue; } +#ifdef CGEN_MNEMONIC_OPERANDS + (void) past_opcode_p; +#endif /* We have an operand of some sort. */ - errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), - &str, fields); + errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); if (errmsg) return errmsg; @@ -676,31 +678,39 @@ fr30_cgen_assemble_insn (CGEN_CPU_DESC cd, { static char errbuf[150]; -#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS const char *tmp_errmsg; - - /* If requesting verbose error messages, use insert_errmsg. - Failing that, use parse_errmsg. */ - tmp_errmsg = (insert_errmsg ? insert_errmsg : - parse_errmsg ? parse_errmsg : - recognized_mnemonic ? - _("unrecognized form of instruction") : - _("unrecognized instruction")); - - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); - else - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS +#define be_verbose 1 #else - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s...'"), start); - else - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s'"), start); +#define be_verbose 0 #endif + + if (be_verbose) + { + /* If requesting verbose error messages, use insert_errmsg. + Failing that, use parse_errmsg. */ + tmp_errmsg = (insert_errmsg ? insert_errmsg : + parse_errmsg ? parse_errmsg : + recognized_mnemonic ? + _("unrecognized form of instruction") : + _("unrecognized instruction")); + + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); + else + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); + } + else + { + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s...'"), start); + else + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s'"), start); + } *errmsg = errbuf; return NULL; diff --git a/opcodes/frv-asm.c b/opcodes/frv-asm.c index c5fa1c7..dffa059 100644 --- a/opcodes/frv-asm.c +++ b/opcodes/frv-asm.c @@ -1510,9 +1510,11 @@ parse_insn_normal (CGEN_CPU_DESC cd, continue; } +#ifdef CGEN_MNEMONIC_OPERANDS + (void) past_opcode_p; +#endif /* We have an operand of some sort. */ - errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), - &str, fields); + errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); if (errmsg) return errmsg; @@ -1629,31 +1631,39 @@ frv_cgen_assemble_insn (CGEN_CPU_DESC cd, { static char errbuf[150]; -#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS const char *tmp_errmsg; - - /* If requesting verbose error messages, use insert_errmsg. - Failing that, use parse_errmsg. */ - tmp_errmsg = (insert_errmsg ? insert_errmsg : - parse_errmsg ? parse_errmsg : - recognized_mnemonic ? - _("unrecognized form of instruction") : - _("unrecognized instruction")); - - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); - else - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS +#define be_verbose 1 #else - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s...'"), start); - else - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s'"), start); +#define be_verbose 0 #endif + + if (be_verbose) + { + /* If requesting verbose error messages, use insert_errmsg. + Failing that, use parse_errmsg. */ + tmp_errmsg = (insert_errmsg ? insert_errmsg : + parse_errmsg ? parse_errmsg : + recognized_mnemonic ? + _("unrecognized form of instruction") : + _("unrecognized instruction")); + + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); + else + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); + } + else + { + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s...'"), start); + else + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s'"), start); + } *errmsg = errbuf; return NULL; diff --git a/opcodes/h8300-dis.c b/opcodes/h8300-dis.c index d6491b8..0d260de 100644 --- a/opcodes/h8300-dis.c +++ b/opcodes/h8300-dis.c @@ -1,6 +1,6 @@ /* Disassemble h8300 instructions. Copyright 1993, 1994, 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007 Free Software Foundation, Inc. + 2007, 2010 Free Software Foundation, Inc. This file is part of the GNU opcodes library. @@ -53,19 +53,6 @@ bfd_h8_disassemble_init (void) for (p = h8_opcodes, pi = h8_instructions; p->name; p++, pi++) { - int n1 = 0; - int n2 = 0; - - if ((int) p->data.nib[0] < 16) - n1 = (int) p->data.nib[0]; - else - n1 = 0; - - if ((int) p->data.nib[1] < 16) - n2 = (int) p->data.nib[1]; - else - n2 = 0; - /* Just make sure there are an even number of nibbles in it, and that the count is the same as the length. */ for (i = 0; p->data.nib[i] != (op_type) E; i++) diff --git a/opcodes/ip2k-asm.c b/opcodes/ip2k-asm.c index a164bc8..03e219c 100644 --- a/opcodes/ip2k-asm.c +++ b/opcodes/ip2k-asm.c @@ -758,9 +758,11 @@ parse_insn_normal (CGEN_CPU_DESC cd, continue; } +#ifdef CGEN_MNEMONIC_OPERANDS + (void) past_opcode_p; +#endif /* We have an operand of some sort. */ - errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), - &str, fields); + errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); if (errmsg) return errmsg; @@ -877,31 +879,39 @@ ip2k_cgen_assemble_insn (CGEN_CPU_DESC cd, { static char errbuf[150]; -#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS const char *tmp_errmsg; - - /* If requesting verbose error messages, use insert_errmsg. - Failing that, use parse_errmsg. */ - tmp_errmsg = (insert_errmsg ? insert_errmsg : - parse_errmsg ? parse_errmsg : - recognized_mnemonic ? - _("unrecognized form of instruction") : - _("unrecognized instruction")); - - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); - else - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS +#define be_verbose 1 #else - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s...'"), start); - else - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s'"), start); +#define be_verbose 0 #endif + + if (be_verbose) + { + /* If requesting verbose error messages, use insert_errmsg. + Failing that, use parse_errmsg. */ + tmp_errmsg = (insert_errmsg ? insert_errmsg : + parse_errmsg ? parse_errmsg : + recognized_mnemonic ? + _("unrecognized form of instruction") : + _("unrecognized instruction")); + + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); + else + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); + } + else + { + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s...'"), start); + else + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s'"), start); + } *errmsg = errbuf; return NULL; diff --git a/opcodes/iq2000-asm.c b/opcodes/iq2000-asm.c index ec31655..13f1cd3 100644 --- a/opcodes/iq2000-asm.c +++ b/opcodes/iq2000-asm.c @@ -706,9 +706,11 @@ parse_insn_normal (CGEN_CPU_DESC cd, continue; } +#ifdef CGEN_MNEMONIC_OPERANDS + (void) past_opcode_p; +#endif /* We have an operand of some sort. */ - errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), - &str, fields); + errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); if (errmsg) return errmsg; @@ -825,31 +827,39 @@ iq2000_cgen_assemble_insn (CGEN_CPU_DESC cd, { static char errbuf[150]; -#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS const char *tmp_errmsg; - - /* If requesting verbose error messages, use insert_errmsg. - Failing that, use parse_errmsg. */ - tmp_errmsg = (insert_errmsg ? insert_errmsg : - parse_errmsg ? parse_errmsg : - recognized_mnemonic ? - _("unrecognized form of instruction") : - _("unrecognized instruction")); - - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); - else - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS +#define be_verbose 1 #else - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s...'"), start); - else - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s'"), start); +#define be_verbose 0 #endif + + if (be_verbose) + { + /* If requesting verbose error messages, use insert_errmsg. + Failing that, use parse_errmsg. */ + tmp_errmsg = (insert_errmsg ? insert_errmsg : + parse_errmsg ? parse_errmsg : + recognized_mnemonic ? + _("unrecognized form of instruction") : + _("unrecognized instruction")); + + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); + else + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); + } + else + { + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s...'"), start); + else + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s'"), start); + } *errmsg = errbuf; return NULL; diff --git a/opcodes/lm32-asm.c b/opcodes/lm32-asm.c index 13328e6..31f4969 100644 --- a/opcodes/lm32-asm.c +++ b/opcodes/lm32-asm.c @@ -596,9 +596,11 @@ parse_insn_normal (CGEN_CPU_DESC cd, continue; } +#ifdef CGEN_MNEMONIC_OPERANDS + (void) past_opcode_p; +#endif /* We have an operand of some sort. */ - errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), - &str, fields); + errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); if (errmsg) return errmsg; @@ -715,31 +717,39 @@ lm32_cgen_assemble_insn (CGEN_CPU_DESC cd, { static char errbuf[150]; -#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS const char *tmp_errmsg; - - /* If requesting verbose error messages, use insert_errmsg. - Failing that, use parse_errmsg. */ - tmp_errmsg = (insert_errmsg ? insert_errmsg : - parse_errmsg ? parse_errmsg : - recognized_mnemonic ? - _("unrecognized form of instruction") : - _("unrecognized instruction")); - - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); - else - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS +#define be_verbose 1 #else - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s...'"), start); - else - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s'"), start); +#define be_verbose 0 #endif + + if (be_verbose) + { + /* If requesting verbose error messages, use insert_errmsg. + Failing that, use parse_errmsg. */ + tmp_errmsg = (insert_errmsg ? insert_errmsg : + parse_errmsg ? parse_errmsg : + recognized_mnemonic ? + _("unrecognized form of instruction") : + _("unrecognized instruction")); + + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); + else + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); + } + else + { + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s...'"), start); + else + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s'"), start); + } *errmsg = errbuf; return NULL; diff --git a/opcodes/m32c-asm.c b/opcodes/m32c-asm.c index 6f724eb..13ab3ca 100644 --- a/opcodes/m32c-asm.c +++ b/opcodes/m32c-asm.c @@ -1831,9 +1831,11 @@ parse_insn_normal (CGEN_CPU_DESC cd, continue; } +#ifdef CGEN_MNEMONIC_OPERANDS + (void) past_opcode_p; +#endif /* We have an operand of some sort. */ - errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), - &str, fields); + errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); if (errmsg) return errmsg; @@ -1950,31 +1952,39 @@ m32c_cgen_assemble_insn (CGEN_CPU_DESC cd, { static char errbuf[150]; -#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS const char *tmp_errmsg; - - /* If requesting verbose error messages, use insert_errmsg. - Failing that, use parse_errmsg. */ - tmp_errmsg = (insert_errmsg ? insert_errmsg : - parse_errmsg ? parse_errmsg : - recognized_mnemonic ? - _("unrecognized form of instruction") : - _("unrecognized instruction")); - - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); - else - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS +#define be_verbose 1 #else - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s...'"), start); - else - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s'"), start); +#define be_verbose 0 #endif + + if (be_verbose) + { + /* If requesting verbose error messages, use insert_errmsg. + Failing that, use parse_errmsg. */ + tmp_errmsg = (insert_errmsg ? insert_errmsg : + parse_errmsg ? parse_errmsg : + recognized_mnemonic ? + _("unrecognized form of instruction") : + _("unrecognized instruction")); + + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); + else + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); + } + else + { + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s...'"), start); + else + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s'"), start); + } *errmsg = errbuf; return NULL; diff --git a/opcodes/m32r-asm.c b/opcodes/m32r-asm.c index 60004c1..eff6da0 100644 --- a/opcodes/m32r-asm.c +++ b/opcodes/m32r-asm.c @@ -575,9 +575,11 @@ parse_insn_normal (CGEN_CPU_DESC cd, continue; } +#ifdef CGEN_MNEMONIC_OPERANDS + (void) past_opcode_p; +#endif /* We have an operand of some sort. */ - errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), - &str, fields); + errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); if (errmsg) return errmsg; @@ -694,31 +696,39 @@ m32r_cgen_assemble_insn (CGEN_CPU_DESC cd, { static char errbuf[150]; -#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS const char *tmp_errmsg; - - /* If requesting verbose error messages, use insert_errmsg. - Failing that, use parse_errmsg. */ - tmp_errmsg = (insert_errmsg ? insert_errmsg : - parse_errmsg ? parse_errmsg : - recognized_mnemonic ? - _("unrecognized form of instruction") : - _("unrecognized instruction")); - - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); - else - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS +#define be_verbose 1 #else - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s...'"), start); - else - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s'"), start); +#define be_verbose 0 #endif + + if (be_verbose) + { + /* If requesting verbose error messages, use insert_errmsg. + Failing that, use parse_errmsg. */ + tmp_errmsg = (insert_errmsg ? insert_errmsg : + parse_errmsg ? parse_errmsg : + recognized_mnemonic ? + _("unrecognized form of instruction") : + _("unrecognized instruction")); + + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); + else + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); + } + else + { + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s...'"), start); + else + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s'"), start); + } *errmsg = errbuf; return NULL; diff --git a/opcodes/maxq-dis.c b/opcodes/maxq-dis.c index 2f82c4d..d7e8997 100644 --- a/opcodes/maxq-dis.c +++ b/opcodes/maxq-dis.c @@ -1,6 +1,6 @@ /* Instruction printing code for the MAXQ - Copyright 2004, 2005, 2007, 2009 Free Software Foundation, Inc. + Copyright 2004, 2005, 2007, 2009, 2010 Free Software Foundation, Inc. Written by Vineet Sharma(vineets@noida.hcltech.com) Inderpreet S.(inderpreetb@noida.hcltech.com) @@ -205,8 +205,6 @@ check_move (unsigned char insn0, unsigned char insn8) { bfd_boolean first = FALSE; bfd_boolean second = FALSE; - char *first_reg; - char *second_reg; reg_entry const *reg_x; const unsigned char module1 = insn0 & MASK_LOW_BYTE; const unsigned char index1 = ((insn0 & 0x70) >> 4); @@ -241,7 +239,6 @@ check_move (unsigned char insn0, unsigned char insn8) /* A[AP] not allowed. */ if ((reg_x->Mod_name == 0x0A) && (reg_x->Mod_index == 0x01)) continue; - first_reg = reg_x->reg_name; first = TRUE; break; } @@ -277,7 +274,6 @@ check_move (unsigned char insn0, unsigned char insn8) && (reg_x->Mod_index == (((insn8 & 0xf0) >> 4)))) { second = TRUE; - second_reg = reg_x->reg_name; break; } } @@ -552,7 +548,7 @@ print_insn (bfd_vma memaddr, struct disassemble_info *info, enum bfd_endian endianess) { /* The raw instruction. */ - unsigned char insn[2], insn0, insn8, derived_code; + unsigned char insn[2], derived_code; unsigned int format; unsigned int actual_operands; unsigned int i; @@ -571,9 +567,6 @@ print_insn (bfd_vma memaddr, struct disassemble_info *info, return -1; } - insn8 = insn[1]; - insn0 = insn[0]; - /* FIXME: Endianness always little. */ if (endianess == BFD_ENDIAN_BIG) get_insn_opcode (((insn[0] << 8) | (insn[1])), &grp); @@ -588,7 +581,7 @@ print_insn (bfd_vma memaddr, struct disassemble_info *info, return 2; } - /* The opcode is always in insn0. */ + /* The opcode is always in insn[0]. */ for (opcode = &op_table[0]; opcode->name != NULL; ++opcode) { if (opcode->instr_id == derived_code) diff --git a/opcodes/mep-asm.c b/opcodes/mep-asm.c index cb0ca82..2fc3087 100644 --- a/opcodes/mep-asm.c +++ b/opcodes/mep-asm.c @@ -1533,9 +1533,11 @@ parse_insn_normal (CGEN_CPU_DESC cd, continue; } +#ifdef CGEN_MNEMONIC_OPERANDS + (void) past_opcode_p; +#endif /* We have an operand of some sort. */ - errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), - &str, fields); + errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); if (errmsg) return errmsg; @@ -1652,31 +1654,39 @@ mep_cgen_assemble_insn (CGEN_CPU_DESC cd, { static char errbuf[150]; -#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS const char *tmp_errmsg; - - /* If requesting verbose error messages, use insert_errmsg. - Failing that, use parse_errmsg. */ - tmp_errmsg = (insert_errmsg ? insert_errmsg : - parse_errmsg ? parse_errmsg : - recognized_mnemonic ? - _("unrecognized form of instruction") : - _("unrecognized instruction")); - - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); - else - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS +#define be_verbose 1 #else - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s...'"), start); - else - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s'"), start); +#define be_verbose 0 #endif + + if (be_verbose) + { + /* If requesting verbose error messages, use insert_errmsg. + Failing that, use parse_errmsg. */ + tmp_errmsg = (insert_errmsg ? insert_errmsg : + parse_errmsg ? parse_errmsg : + recognized_mnemonic ? + _("unrecognized form of instruction") : + _("unrecognized instruction")); + + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); + else + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); + } + else + { + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s...'"), start); + else + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s'"), start); + } *errmsg = errbuf; return NULL; diff --git a/opcodes/mep-dis.c b/opcodes/mep-dis.c index e0f2616..dbf429a 100644 --- a/opcodes/mep-dis.c +++ b/opcodes/mep-dis.c @@ -534,14 +534,12 @@ mep_examine_ivc2_insns (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_ { int status; int buflength; - int cop2buflength; bfd_byte buf[8]; bfd_byte insn[8]; int e; /* At this time we're not supporting internally parallel coprocessors, so cop2buflength will always be 0. */ - cop2buflength = 0; /* Read in 64 bits. */ buflength = 8; /* VLIW insn spans 8 bytes. */ diff --git a/opcodes/msp430-dis.c b/opcodes/msp430-dis.c index c4a86eb..9d7edbe 100644 --- a/opcodes/msp430-dis.c +++ b/opcodes/msp430-dis.c @@ -1,5 +1,6 @@ /* Disassemble MSP430 instructions. - Copyright (C) 2002, 2004, 2005, 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005, 2007, 2009, 2010 + Free Software Foundation, Inc. Contributed by Dmitry Diky <diwil@mail.ru> @@ -546,14 +547,13 @@ msp430_branchinstr (disassemble_info *info, int *cycles) { int regs = 0, regd = 0; - int ad = 0, as = 0; + int as = 0; int cmd_len = 2; short dst = 0; regd = insn & 0x0f; regs = (insn & 0x0f00) >> 8; as = (insn & 0x0030) >> 4; - ad = (insn & 0x0080) >> 7; if (regd != 0) /* Destination register is not a PC. */ return 0; diff --git a/opcodes/mt-asm.c b/opcodes/mt-asm.c index 6bf31ba..8dbbabf 100644 --- a/opcodes/mt-asm.c +++ b/opcodes/mt-asm.c @@ -842,9 +842,11 @@ parse_insn_normal (CGEN_CPU_DESC cd, continue; } +#ifdef CGEN_MNEMONIC_OPERANDS + (void) past_opcode_p; +#endif /* We have an operand of some sort. */ - errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), - &str, fields); + errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); if (errmsg) return errmsg; @@ -961,31 +963,39 @@ mt_cgen_assemble_insn (CGEN_CPU_DESC cd, { static char errbuf[150]; -#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS const char *tmp_errmsg; - - /* If requesting verbose error messages, use insert_errmsg. - Failing that, use parse_errmsg. */ - tmp_errmsg = (insert_errmsg ? insert_errmsg : - parse_errmsg ? parse_errmsg : - recognized_mnemonic ? - _("unrecognized form of instruction") : - _("unrecognized instruction")); - - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); - else - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS +#define be_verbose 1 #else - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s...'"), start); - else - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s'"), start); +#define be_verbose 0 #endif + + if (be_verbose) + { + /* If requesting verbose error messages, use insert_errmsg. + Failing that, use parse_errmsg. */ + tmp_errmsg = (insert_errmsg ? insert_errmsg : + parse_errmsg ? parse_errmsg : + recognized_mnemonic ? + _("unrecognized form of instruction") : + _("unrecognized instruction")); + + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); + else + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); + } + else + { + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s...'"), start); + else + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s'"), start); + } *errmsg = errbuf; return NULL; diff --git a/opcodes/openrisc-asm.c b/opcodes/openrisc-asm.c index c9e4a3d..8aaf374 100644 --- a/opcodes/openrisc-asm.c +++ b/opcodes/openrisc-asm.c @@ -488,9 +488,11 @@ parse_insn_normal (CGEN_CPU_DESC cd, continue; } +#ifdef CGEN_MNEMONIC_OPERANDS + (void) past_opcode_p; +#endif /* We have an operand of some sort. */ - errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), - &str, fields); + errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); if (errmsg) return errmsg; @@ -607,31 +609,39 @@ openrisc_cgen_assemble_insn (CGEN_CPU_DESC cd, { static char errbuf[150]; -#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS const char *tmp_errmsg; - - /* If requesting verbose error messages, use insert_errmsg. - Failing that, use parse_errmsg. */ - tmp_errmsg = (insert_errmsg ? insert_errmsg : - parse_errmsg ? parse_errmsg : - recognized_mnemonic ? - _("unrecognized form of instruction") : - _("unrecognized instruction")); - - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); - else - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS +#define be_verbose 1 #else - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s...'"), start); - else - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s'"), start); +#define be_verbose 0 #endif + + if (be_verbose) + { + /* If requesting verbose error messages, use insert_errmsg. + Failing that, use parse_errmsg. */ + tmp_errmsg = (insert_errmsg ? insert_errmsg : + parse_errmsg ? parse_errmsg : + recognized_mnemonic ? + _("unrecognized form of instruction") : + _("unrecognized instruction")); + + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); + else + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); + } + else + { + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s...'"), start); + else + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s'"), start); + } *errmsg = errbuf; return NULL; diff --git a/opcodes/sparc-dis.c b/opcodes/sparc-dis.c index 6a7649b..8dec272 100644 --- a/opcodes/sparc-dis.c +++ b/opcodes/sparc-dis.c @@ -1,6 +1,6 @@ /* Print SPARC instructions. Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008 + 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc. This file is part of the GNU opcodes library. @@ -995,7 +995,8 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info) if (opcode->flags & (F_UNBR|F_CONDBR|F_JSR)) { - /* FIXME -- check is_annulled flag. */ + /* FIXME -- check is_annulled flag. */ + (void) is_annulled; if (opcode->flags & F_UNBR) info->insn_type = dis_branch; if (opcode->flags & F_CONDBR) diff --git a/opcodes/xc16x-asm.c b/opcodes/xc16x-asm.c index fefa040..c7903e1 100644 --- a/opcodes/xc16x-asm.c +++ b/opcodes/xc16x-asm.c @@ -623,9 +623,11 @@ parse_insn_normal (CGEN_CPU_DESC cd, continue; } +#ifdef CGEN_MNEMONIC_OPERANDS + (void) past_opcode_p; +#endif /* We have an operand of some sort. */ - errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), - &str, fields); + errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); if (errmsg) return errmsg; @@ -742,31 +744,39 @@ xc16x_cgen_assemble_insn (CGEN_CPU_DESC cd, { static char errbuf[150]; -#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS const char *tmp_errmsg; - - /* If requesting verbose error messages, use insert_errmsg. - Failing that, use parse_errmsg. */ - tmp_errmsg = (insert_errmsg ? insert_errmsg : - parse_errmsg ? parse_errmsg : - recognized_mnemonic ? - _("unrecognized form of instruction") : - _("unrecognized instruction")); - - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); - else - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS +#define be_verbose 1 #else - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s...'"), start); - else - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s'"), start); +#define be_verbose 0 #endif + + if (be_verbose) + { + /* If requesting verbose error messages, use insert_errmsg. + Failing that, use parse_errmsg. */ + tmp_errmsg = (insert_errmsg ? insert_errmsg : + parse_errmsg ? parse_errmsg : + recognized_mnemonic ? + _("unrecognized form of instruction") : + _("unrecognized instruction")); + + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); + else + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); + } + else + { + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s...'"), start); + else + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s'"), start); + } *errmsg = errbuf; return NULL; diff --git a/opcodes/xstormy16-asm.c b/opcodes/xstormy16-asm.c index 90d39e3..1191c64 100644 --- a/opcodes/xstormy16-asm.c +++ b/opcodes/xstormy16-asm.c @@ -523,9 +523,11 @@ parse_insn_normal (CGEN_CPU_DESC cd, continue; } +#ifdef CGEN_MNEMONIC_OPERANDS + (void) past_opcode_p; +#endif /* We have an operand of some sort. */ - errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), - &str, fields); + errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); if (errmsg) return errmsg; @@ -642,31 +644,39 @@ xstormy16_cgen_assemble_insn (CGEN_CPU_DESC cd, { static char errbuf[150]; -#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS const char *tmp_errmsg; - - /* If requesting verbose error messages, use insert_errmsg. - Failing that, use parse_errmsg. */ - tmp_errmsg = (insert_errmsg ? insert_errmsg : - parse_errmsg ? parse_errmsg : - recognized_mnemonic ? - _("unrecognized form of instruction") : - _("unrecognized instruction")); - - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); - else - /* xgettext:c-format */ - sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS +#define be_verbose 1 #else - if (strlen (start) > 50) - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s...'"), start); - else - /* xgettext:c-format */ - sprintf (errbuf, _("bad instruction `%.50s'"), start); +#define be_verbose 0 #endif + + if (be_verbose) + { + /* If requesting verbose error messages, use insert_errmsg. + Failing that, use parse_errmsg. */ + tmp_errmsg = (insert_errmsg ? insert_errmsg : + parse_errmsg ? parse_errmsg : + recognized_mnemonic ? + _("unrecognized form of instruction") : + _("unrecognized instruction")); + + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); + else + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); + } + else + { + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s...'"), start); + else + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s'"), start); + } *errmsg = errbuf; return NULL; |