]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use pulongest in aarch64-linux-tdep.c
authorTom Tromey <tom@tromey.com>
Wed, 15 Aug 2018 16:05:01 +0000 (10:05 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 15 Aug 2018 16:05:01 +0000 (10:05 -0600)
While testing a patch on the buildbot, I got this error:

../../binutils-gdb/gdb/aarch64-linux-tdep.c: In function uint64_t aarch64_linux_core_read_vq(gdbarch*, bfd*):
../../binutils-gdb/gdb/aarch64-linux-tdep.c:285:29: error: format %ld expects argument of type long int, but argument 2 has type uint64_t {aka long long unsigned int} [-Werror=format=]

This patch avoids the problem by using pulongest rather than %ld.
This seems safe to me because, if aarch64-linux-tdep.c is included in
the build, then ULONGEST must be a 64-bit type.

gdb/ChangeLog
2018-08-15  Tom Tromey  <tom@tromey.com>

* aarch64-linux-tdep.c (aarch64_linux_core_read_vq): Use pulongest.

gdb/ChangeLog
gdb/aarch64-linux-tdep.c

index d16920d80e9a5721d9096f5b79f3978042e5593e..9fac8ccf5f4278a321f689f91cbec6b95e89b1f3 100644 (file)
@@ -1,3 +1,7 @@
+2018-08-15  Tom Tromey  <tom@tromey.com>
+
+       * aarch64-linux-tdep.c (aarch64_linux_core_read_vq): Use pulongest.
+
 2018-08-14  Jan Vrany  <jan.vrany@fit.cvut.cz>
 
        * mi/mi-cmd-disas.c (mi_cmd_disassemble): Add -a option.
index 99e6a1590b80ad1bc3a3b3b19cf0811b27ea229c..389f4f494ec06f1b4a3f05cc8c0ce060d66f0daa 100644 (file)
@@ -282,12 +282,13 @@ aarch64_linux_core_read_vq (struct gdbarch *gdbarch, bfd *abfd)
   if (vq > AARCH64_MAX_SVE_VQ)
     {
       warning (_("SVE Vector length in core file not supported by this version"
-                " of GDB.  (VQ=%ld)"), vq);
+                " of GDB.  (VQ=%s)"), pulongest (vq));
       return 0;
     }
   else if (vq == 0)
     {
-      warning (_("SVE Vector length in core file is invalid. (VQ=%ld"), vq);
+      warning (_("SVE Vector length in core file is invalid. (VQ=%s"),
+              pulongest (vq));
       return 0;
     }