public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Simon Marchi <simark@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] gdb: fix dwarf2/cooked-index.c compilation on 32-bit systems
Date: Mon, 30 Jan 2023 21:15:24 +0000 (GMT)	[thread overview]
Message-ID: <20230130211524.B52E73858C2B@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=902d61e3285aa88e635195a0f77541c44d1dfb2c

commit 902d61e3285aa88e635195a0f77541c44d1dfb2c
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Mon Jan 30 15:46:15 2023 -0500

    gdb: fix dwarf2/cooked-index.c compilation on 32-bit systems
    
    The i386 builder shows:
    
        ../../binutils-gdb/gdb/dwarf2/cooked-index.c: In member function ‘void cooked_index_vector::dump(gdbarch*) const’:
        ../../binutils-gdb/gdb/dwarf2/cooked-index.c:492:40: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘std::__underlying_type_impl<sect_offset, true>::type’ {aka ‘long long unsigned int’} [-Werror=format=]
          492 |       gdb_printf ("    DIE offset: 0x%lx\n",
              |                                      ~~^
              |                                        |
              |                                        long unsigned int
              |                                      %llx
          493 |     to_underlying (entry->die_offset));
              |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              |                   |
              |                   std::__underlying_type_impl<sect_offset, true>::type {aka long long unsigned int}
    
    The die_offset's underlying type is uint64, so use PRIx64 in the format
    string.
    
    Change-Id: Ibdde4c624ed1bb50eced9a514a4e37aec70a1323

Diff:
---
 gdb/dwarf2/cooked-index.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c
index 9dbb844cade..82dc44dd74b 100644
--- a/gdb/dwarf2/cooked-index.c
+++ b/gdb/dwarf2/cooked-index.c
@@ -489,7 +489,7 @@ cooked_index_vector::dump (gdbarch *arch) const
       gdb_printf ("    canonical:  %s\n", entry->canonical);
       gdb_printf ("    DWARF tag:  %s\n", dwarf_tag_name (entry->tag));
       gdb_printf ("    flags:      %s\n", to_string (entry->flags).c_str ());
-      gdb_printf ("    DIE offset: 0x%lx\n",
+      gdb_printf ("    DIE offset: 0x%" PRIx64 "\n",
 		  to_underlying (entry->die_offset));
 
       if (entry->parent_entry != nullptr)

                 reply	other threads:[~2023-01-30 21:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230130211524.B52E73858C2B@sourceware.org \
    --to=simark@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).