[PATCH v1] bfd: use correct format specifier for uint64_t

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Thu Jan 22 13:29:29 GMT 2026


Hi Jan,

> On 22.01.2026 13:57, Matthieu Longo wrote:
>> ---
>>  bfd/elf-attrs.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Counts as obvious, I'd say, but just in case: Okay.

testing on sparc-sun-solaris2.11, i386-pc-solaris2.11, and
i686-pc-linux-gnu with --enable-64-bit-bfd, I needed two more to
address

In file included from bfd/elf-attrs.c:140:
bfd/elf-attrs.c: In function ‘oav2_parse_subsection’:
bfd/elf-attrs.c:2752:29: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Werror=format=]
 2752 |       _bfd_error_handler (_("%pB: error: bad subsection length (%u > max=%lu)"),

In file included from /vol/src/gnu/binutils/hg/master/testing/bfd/sysdep.h:165,
                 from /vol/src/gnu/binutils/hg/master/testing/bfd/elf-attrs.c:140:
bfd/elf-attrs.c: In function ‘_bfd_elf_parse_attributes’:
bfd/elf-attrs.c:2910:12: error: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘bfd_size_type’ {aka ‘unsigned int’} [-Werror=format=]
 2910 |         (_("%pB: error: attribute section '%pA' too big: %" PRId64),

Tested on all of the above.

Ok for trunk?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2026-01-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	bfd:
	* elf-attrs.c (oav2_parse_subsection): Use PRIu64 to print
	uint64_t.
	(_bfd_elf_parse_attributes): Cast bfd_size_t arg to uint64_t.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ea.patch
Type: text/x-patch
Size: 967 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20260122/34445de3/attachment-0001.bin>


More information about the Binutils mailing list