diff options
author | Alan Modra <amodra@gmail.com> | 2022-08-04 12:22:39 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-08-04 12:22:39 +0930 |
commit | b82817674f46e4f08a5910719499ddc72399473f (patch) | |
tree | 079452a4c6a71ffe6493a8a818007700dad6c7e5 /binutils/bucomm.c | |
parent | 6b9bd54c24dcf08e400e5b79a958e051ccfde30d (diff) | |
download | gdb-b82817674f46e4f08a5910719499ddc72399473f.zip gdb-b82817674f46e4f08a5910719499ddc72399473f.tar.gz gdb-b82817674f46e4f08a5910719499ddc72399473f.tar.bz2 |
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 'binutils/bucomm.c')
-rw-r--r-- | binutils/bucomm.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/binutils/bucomm.c b/binutils/bucomm.c index 5834190..5c4abf9 100644 --- a/binutils/bucomm.c +++ b/binutils/bucomm.c @@ -455,7 +455,6 @@ print_arelt_descr (FILE *file, bfd *abfd, bool verbose, bool offsets) char timebuf[40]; time_t when = buf.st_mtime; const char *ctime_result = (const char *) ctime (&when); - bfd_size_type size; /* PR binutils/17605: Check for corrupt time values. */ if (ctime_result == NULL) @@ -466,11 +465,10 @@ print_arelt_descr (FILE *file, bfd *abfd, bool verbose, bool offsets) mode_string (buf.st_mode, modebuf); modebuf[10] = '\0'; - size = buf.st_size; /* POSIX 1003.2/D11 says to skip first character (entry type). */ - fprintf (file, "%s %ld/%ld %6" BFD_VMA_FMT "u %s ", modebuf + 1, + fprintf (file, "%s %ld/%ld %6" PRIu64 " %s ", modebuf + 1, (long) buf.st_uid, (long) buf.st_gid, - size, timebuf); + (uint64_t) buf.st_size, timebuf); } } |