[PATCH v2] bfd: Use PRIu64 to print uint64_t in elf-attrs.c
Jan Beulich
jbeulich@suse.com
Thu Jan 22 15:14:09 GMT 2026
On 22.01.2026 16:08, Rainer Orth wrote:
>>> --- a/bfd/elf-attrs.c
>>> +++ b/bfd/elf-attrs.c
>>> @@ -2749,8 +2749,8 @@ oav2_parse_subsection (bfd *abfd,
>>> cursor += F_SUBSECTION_LEN;
>>> if (subsection_len > max_read)
>>> {
>>> - _bfd_error_handler (_("%pB: error: bad subsection length (%u > max=%lu)"),
>>> - abfd, subsection_len, max_read);
>>> + _bfd_error_handler (_("%pB: error: bad subsection length (%u > max=%"
>>> + PRIu64 ")"), abfd, subsection_len, max_read);
>>
>> Please don't wrap the format string in such a case, and especially not like
>> this. It running slightly past 80 chars ought to be okay(ish). Else move
>> everything from the opening parenthesis onwards to the next line. In no case
>> should more arguments follow on the same line that already continues an
>> argument from an earlier one.
>>
>> (I'm sure I had pointed out this particular instance to Matthieu.)
>>
>> Okay with at least this adjustment, but read on.
>>
>> @@ -2908,7 +2908,7 @@ void
>> {
>> _bfd_error_handler
>> (_("%pB: error: attribute section '%pA' too big: %" PRId64),
>> - abfd, hdr->bfd_section, hdr->sh_size);
>> + abfd, hdr->bfd_section, (uint64_t) hdr->sh_size);
>>
>> Could I talk you into switching PRId64 to PRIu64 here at the same time?
>
> Sure, both included.
>
> I guess this is ok now?
Yes, and thanks.
Jan
More information about the Binutils
mailing list