]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/build] Fix Wformat errors in gdb/riscv-tdep.c
authorTom de Vries <tdevries@suse.de>
Wed, 30 Apr 2025 07:49:58 +0000 (09:49 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 30 Apr 2025 07:49:58 +0000 (09:49 +0200)
commit5f02f0fae18c996541fb40c85bd98d1a5ab990dd
treec89492d1bc802dd5034e7bd17bdd1c0c3ce2b055
parent10ec3d5de0ee75ad56029bfa6b5d3be99f4eac3c
[gdb/build] Fix Wformat errors in gdb/riscv-tdep.c

When building gdb with --enable-targets=all on arm-linux, I run into:
...
gdb/riscv-tdep.c: In function ‘bool try_read(regcache*, int, ULONGEST&)’:
gdb/riscv-tdep.c:4887:18: error: format ‘%lx’ expects argument of type \
  ‘long unsigned int’, but argument 2 has type ‘ULONGEST’ \
  {aka ‘long long unsigned int’} [-Werror=format=]
 4887 |       warning (_("Can not read at address %lx"), addr);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
and a few more Wformat errors, due to commit b9c7eed0c24 ("This commit adds
record full support for rv64gc instruction set").

Fix these by using hex_string.

Tested by completing a build on arm-linux.
gdb/riscv-tdep.c