* config/tc-arm.c (ldst_extend): Add parentheses to avoid

warning.
	(do_ldst): Move assignment out of if condition.
	(md_apply_fix3): Add casts to avoid printf format warnings.  Add
	parentheses to avoid warning.
This commit is contained in:
Ian Lance Taylor 1999-06-21 10:03:29 +00:00
parent 155f0fe7a5
commit 3d10331912
2 changed files with 23 additions and 10 deletions

View file

@ -1,3 +1,11 @@
1999-06-21 Ian Lance Taylor <ian@zembu.com>
* config/tc-arm.c (ldst_extend): Add parentheses to avoid
warning.
(do_ldst): Move assignment out of if condition.
(md_apply_fix3): Add casts to avoid printf format warnings. Add
parentheses to avoid warning.
1999-06-21 Nick Clifton <nickc@cygnus.com> 1999-06-21 Nick Clifton <nickc@cygnus.com>
* config/tc-arm.c (arm_adjust_symtab): Use symbol_get_bfdsym() * config/tc-arm.c (arm_adjust_symtab): Use symbol_get_bfdsym()

View file

@ -2700,7 +2700,7 @@ ldst_extend (str, hwse)
/* Halfword and signextension instructions have the /* Halfword and signextension instructions have the
immediate value split across bits 11..8 and bits 3..0 */ immediate value split across bits 11..8 and bits 3..0 */
if (hwse) if (hwse)
inst.instruction |= add | HWOFFSET_IMM | (value >> 4) << 8 | value & 0xF; inst.instruction |= add | HWOFFSET_IMM | ((value >> 4) << 8) | (value & 0xF);
else else
inst.instruction |= add | value; inst.instruction |= add | value;
} }
@ -2751,7 +2751,8 @@ do_ldst (str, flags)
/* This is not ideal, but it is the simplest way of dealing with the /* This is not ideal, but it is the simplest way of dealing with the
ARM7T halfword instructions (since they use a different ARM7T halfword instructions (since they use a different
encoding, but the same mnemonic): */ encoding, but the same mnemonic): */
if (halfword = ((flags & 0x80000000) != 0)) halfword = (flags & 0x80000000) != 0;
if (halfword)
{ {
/* This is actually a load/store of a halfword, or a /* This is actually a load/store of a halfword, or a
signed-extension load */ signed-extension load */
@ -5316,7 +5317,8 @@ md_apply_fix3 (fixP, val, seg)
&& (newimm = negate_data_op (&temp, value)) == (unsigned int) FAIL) && (newimm = negate_data_op (&temp, value)) == (unsigned int) FAIL)
{ {
as_bad_where (fixP->fx_file, fixP->fx_line, as_bad_where (fixP->fx_file, fixP->fx_line,
_("invalid constant (%x) after fixup\n"), value); _("invalid constant (%lx) after fixup\n"),
(unsigned long) value);
break; break;
} }
@ -5328,7 +5330,7 @@ md_apply_fix3 (fixP, val, seg)
sign = value >= 0; sign = value >= 0;
if ((value = validate_offset_imm (value, 0)) == FAIL) if ((value = validate_offset_imm (value, 0)) == FAIL)
{ {
as_bad (_("bad immediate value for offset (%d)"), val); as_bad (_("bad immediate value for offset (%ld)"), (long) value);
break; break;
} }
if (value < 0) if (value < 0)
@ -5349,7 +5351,7 @@ md_apply_fix3 (fixP, val, seg)
as_bad_where (fixP->fx_file, fixP->fx_line, as_bad_where (fixP->fx_file, fixP->fx_line,
_("invalid literal constant: pool needs to be closer\n")); _("invalid literal constant: pool needs to be closer\n"));
else else
as_bad (_("bad immediate value for offset (%d)"), value); as_bad (_("bad immediate value for offset (%ld)"), (long) value);
break; break;
} }
@ -5358,7 +5360,7 @@ md_apply_fix3 (fixP, val, seg)
newval = md_chars_to_number (buf, INSN_SIZE); newval = md_chars_to_number (buf, INSN_SIZE);
newval &= 0xff7ff0f0; newval &= 0xff7ff0f0;
newval |= ((value >> 4) << 8) | value & 0xf | (sign ? INDEX_UP : 0); newval |= ((value >> 4) << 8) | (value & 0xf) | (sign ? INDEX_UP : 0);
md_number_to_chars (buf, newval, INSN_SIZE); md_number_to_chars (buf, newval, INSN_SIZE);
break; break;
@ -5618,7 +5620,8 @@ md_apply_fix3 (fixP, val, seg)
default: default:
as_bad_where (fixP->fx_file, fixP->fx_line, as_bad_where (fixP->fx_file, fixP->fx_line,
"Unable to process relocation for thumb opcode: %x", newval); "Unable to process relocation for thumb opcode: %lx",
(unsigned long) newval);
break; break;
} }
md_number_to_chars (buf, newval, THUMB_SIZE); md_number_to_chars (buf, newval, THUMB_SIZE);
@ -5657,7 +5660,8 @@ md_apply_fix3 (fixP, val, seg)
if (subtract || if (subtract ||
value & ~0x3fc) value & ~0x3fc)
as_bad_where (fixP->fx_file, fixP->fx_line, as_bad_where (fixP->fx_file, fixP->fx_line,
_("Invalid immediate for address calculation (value = 0x%08X)"), value); _("Invalid immediate for address calculation (value = 0x%08lX)"),
(unsigned long) value);
newval = (rs == REG_PC ? T_OPCODE_ADD_PC : T_OPCODE_ADD_SP); newval = (rs == REG_PC ? T_OPCODE_ADD_PC : T_OPCODE_ADD_SP);
newval |= rd << 8; newval |= rd << 8;
newval |= value >> 2; newval |= value >> 2;
@ -5690,7 +5694,8 @@ md_apply_fix3 (fixP, val, seg)
case 0x05: /* 8bit immediate CMP */ case 0x05: /* 8bit immediate CMP */
if (value < 0 || value > 255) if (value < 0 || value > 255)
as_bad_where (fixP->fx_file, fixP->fx_line, as_bad_where (fixP->fx_file, fixP->fx_line,
_("Invalid immediate: %d is too large"), value); _("Invalid immediate: %ld is too large"),
(long) value);
newval |= value; newval |= value;
break; break;
@ -5704,7 +5709,7 @@ md_apply_fix3 (fixP, val, seg)
/* 5bit shift value (0..31) */ /* 5bit shift value (0..31) */
if (value < 0 || value > 31) if (value < 0 || value > 31)
as_bad_where (fixP->fx_file, fixP->fx_line, as_bad_where (fixP->fx_file, fixP->fx_line,
_("Illegal Thumb shift value: %d"), value); _("Illegal Thumb shift value: %ld"), (long) value);
newval = md_chars_to_number (buf, THUMB_SIZE) & 0xf03f; newval = md_chars_to_number (buf, THUMB_SIZE) & 0xf03f;
newval |= value << 6; newval |= value << 6;
md_number_to_chars (buf, newval , THUMB_SIZE); md_number_to_chars (buf, newval , THUMB_SIZE);