aboutsummaryrefslogtreecommitdiff
path: root/opcodes/xc16x-asm.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-06-27 04:07:55 +0000
committerAlan Modra <amodra@gmail.com>2010-06-27 04:07:55 +0000
commitc7e2358a8849d7540212543e1a2acbac648cb973 (patch)
treea882f5a804c7dca6bde423d24e5b13b1a3eeff32 /opcodes/xc16x-asm.c
parent1addfd92eb085db42013c4d45e3df8bf2053cde4 (diff)
downloadgdb-c7e2358a8849d7540212543e1a2acbac648cb973.zip
gdb-c7e2358a8849d7540212543e1a2acbac648cb973.tar.gz
gdb-c7e2358a8849d7540212543e1a2acbac648cb973.tar.bz2
fix set but unused variable warnings
Diffstat (limited to 'opcodes/xc16x-asm.c')
-rw-r--r--opcodes/xc16x-asm.c58
1 files changed, 34 insertions, 24 deletions
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;