summaryrefslogtreecommitdiff
path: root/opcodes/s12z-dis.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-08-04 12:22:39 +0930
committerAlan Modra <amodra@gmail.com>2022-08-04 12:22:39 +0930
commitb82817674f46e4f08a5910719499ddc72399473f (patch)
tree079452a4c6a71ffe6493a8a818007700dad6c7e5 /opcodes/s12z-dis.c
parent6b9bd54c24dcf08e400e5b79a958e051ccfde30d (diff)
downloadbinutils-gdb-b82817674f46e4f08a5910719499ddc72399473f.tar.gz
Don't use BFD_VMA_FMT in binutils
BFD_VMA_FMT can't be used in format strings that need to be translated, because the translation won't work when the type of bfd_vma differs from the machine used to compile .pot files. We've known about this for a long time, but patches slip through review. So just get rid of BFD_VMA_FMT, instead using the appropriate PRId64, PRIu64, PRIx64 or PRIo64 and SCN variants for scanf. The patch is mostly mechanical, the only thing requiring any thought is casts needed to preserve PRId64 output from bfd_vma values, or to preserve one of the unsigned output formats from bfd_signed_vma values.
Diffstat (limited to 'opcodes/s12z-dis.c')
-rw-r--r--opcodes/s12z-dis.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/opcodes/s12z-dis.c b/opcodes/s12z-dis.c
index 972aad80bff..4c07d5a41f2 100644
--- a/opcodes/s12z-dis.c
+++ b/opcodes/s12z-dis.c
@@ -205,14 +205,14 @@ operand_separator (struct disassemble_info *info)
there is no symbol. If BASE is non zero, then the a PC relative adddress is
assumend (ie BASE is the value in the PC. */
static void
-decode_possible_symbol (bfd_vma addr, bfd_vma base,
+decode_possible_symbol (bfd_signed_vma addr, bfd_vma base,
struct disassemble_info *info, bool relative)
{
- const char *fmt = relative ? "*%+" BFD_VMA_FMT "d" : "%" BFD_VMA_FMT "d";
+ const char *fmt = relative ? "*%+" PRId64 : "%" PRId64;
asymbol *sym = info->symbol_at_address_func (addr + base, info);
if (!sym)
- (*info->fprintf_func) (info->stream, fmt, addr);
+ (*info->fprintf_func) (info->stream, fmt, (int64_t) addr);
else
(*info->fprintf_func) (info->stream, "%s", bfd_asymbol_name (sym));
}