From: "Aktemur, Baris" <TankutBaris.Aktemur@amd.com>
To: Simon Marchi <simark@simark.ca>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: "Six, Lancelot" <Lancelot.Six@amd.com>
Subject: RE: [PATCH 1/2] gdb, amd-dbgapi-target: use '%u' instead of '%d' in wave_coordinates::to_string
Date: Fri, 3 Jul 2026 13:27:13 +0000 [thread overview]
Message-ID: <DM4PR12MB647077CD4D6BDC37F9CDD061F8F42@DM4PR12MB6470.namprd12.prod.outlook.com> (raw)
In-Reply-To: <756f19a3-7341-486a-a0cd-00d97634595e@simark.ca>
AMD General
On Friday, July 3, 2026 3:13 PM, Simon Marchi wrote:
> On 7/3/26 8:50 AM, Tankut Baris Aktemur wrote:
> > The group id coordinates and the wave number in workgroup that are
> > being formatted to a string in wave_coordinates::to_string are
> > unsigned values. Use '%u' instead of '%d'.
>
> Do we get a compiler warning for this? Or do they warn only if there is
> a size mismatch, not a sign mismatch?
As far as I know, no warning.
> > ---
> > gdb/amd-dbgapi-target.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/gdb/amd-dbgapi-target.c b/gdb/amd-dbgapi-target.c
> > index caae9a98501..923b790664e 100644
> > --- a/gdb/amd-dbgapi-target.c
> > +++ b/gdb/amd-dbgapi-target.c
> > @@ -406,12 +406,12 @@ wave_coordinates::to_string () const
> > str += string_printf (":%s", pulongest (wave_id.handle));
> >
> > str += (group_ids[0] != UINT32_MAX
> > - ? string_printf (" (%d,%d,%d)", group_ids[0], group_ids[1],
> > + ? string_printf (" (%u,%u,%u)", group_ids[0], group_ids[1],
> > group_ids[2])
> > : " (?,?,?)");
> >
> > str += (wave_in_group != UINT32_MAX
> > - ? string_printf ("/%d", wave_in_group)
> > + ? string_printf ("/%u", wave_in_group)
> > : "/?");
>
> All these are std::uint32_t, so we should probably use PRIu32 (or
> pulongest).
I'll send an update with pulongest.
-Baris
next prev parent reply other threads:[~2026-07-03 13:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 12:50 Tankut Baris Aktemur
2026-07-03 12:50 ` [PATCH 2/2] gdb, amd-dbgapi-target: split wave_coordinates::to_string Tankut Baris Aktemur
2026-07-03 13:16 ` Simon Marchi
2026-07-06 10:45 ` Lancelot SIX
2026-07-03 13:12 ` [PATCH 1/2] gdb, amd-dbgapi-target: use '%u' instead of '%d' in wave_coordinates::to_string Simon Marchi
2026-07-03 13:27 ` Aktemur, Baris [this message]
2026-07-03 13:42 ` [PATCH v2 1/2] gdb, amd-dbgapi-target: use pulongest more Tankut Baris Aktemur
2026-07-06 10:31 ` 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=DM4PR12MB647077CD4D6BDC37F9CDD061F8F42@DM4PR12MB6470.namprd12.prod.outlook.com \
--to=tankutbaris.aktemur@amd.com \
--cc=Lancelot.Six@amd.com \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/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