From: Tom Tromey <tom@tromey.com>
To: Pedro Alves <pedro@palves.net>
Cc: Tom Tromey <tom@tromey.com>, Lancelot SIX <Lancelot.Six@amd.com>,
Tankut Baris Aktemur <tankutbaris.aktemur@amd.com>,
gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb, amd-dbgapi-target: use PRIu64 and PRIu32
Date: Fri, 03 Jul 2026 12:15:45 -0600 [thread overview]
Message-ID: <87wlvcgcry.fsf@tromey.com> (raw)
In-Reply-To: <20854a3f-d7ab-4fdb-b694-a12a16315de0@palves.net> (Pedro Alves's message of "Fri, 3 Jul 2026 14:47:25 +0100")
>>>>> "Pedro" == Pedro Alves <pedro@palves.net> writes:
Pedro> Agreed. And it's also a portability hazard, like other printf
Pedro> formats, as you have to match the printf format to the type of
Pedro> the variable.
Yeah, I meant to point this out as well.
For pulongest you really only need to know whether the type is signed;
and we could easily fix that if we cared to.
Pedro> (std::cout << ... << ... tends to be unreadable too IMHO, but we don't use that, thankfully).
I thought about this for ui_file but meh. It's kind of i18n-unfriendly
as well.
Pedro> {fmt} would be better, but that's either a new external dependency, or
Pedro> bump to c++20 for std::format, or c++23 for widely available std::print.
I looked into this but it is also i18n-unfriendly, since as far as I can
tell it requires you to either give up gettext or give up any sort of
format checking. For printf this isn't an issue because GCC understands
that _() is "transparent".
Also of course switching to fmt would be a colossal effort.
Tom
next prev parent reply other threads:[~2026-07-03 18:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 14:28 Tankut Baris Aktemur
2026-07-01 15:16 ` Lancelot SIX
2026-07-01 16:56 ` Aktemur, Baris
2026-07-02 20:15 ` Tom Tromey
2026-07-03 12:59 ` Simon Marchi
2026-07-03 13:47 ` Pedro Alves
2026-07-03 18:15 ` Tom Tromey [this message]
2026-07-03 19:18 ` Pedro Alves
2026-07-03 19:22 ` Pedro Alves
2026-07-03 11:03 ` [PATCH v2] gdb, amd-dbgapi-target: use pulongest to print id handles Tankut Baris Aktemur
2026-07-03 11:22 ` Lancelot SIX
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wlvcgcry.fsf@tromey.com \
--to=tom@tromey.com \
--cc=Lancelot.Six@amd.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@palves.net \
--cc=tankutbaris.aktemur@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox