This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] arc: Fix ARI warning for printf(%p)
- From: Anton Kolesov <akolesov at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 22 Sep 2016 11:28:43 -0000
- Subject: [binutils-gdb] arc: Fix ARI warning for printf(%p)
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fa42dd2e8328560e65c888277ab146810c1763a8
commit fa42dd2e8328560e65c888277ab146810c1763a8
Author: Anton Kolesov <Anton.Kolesov@synopsys.com>
Date: Thu Sep 22 13:29:43 2016 +0300
arc: Fix ARI warning for printf(%p)
Replace printf ("%p") with printf ("%s", host_address_to_string ()). Printing
host addrss might make sense here because pointers can be null and this would
affect how function behaves.
This particular warning is printed only when option -Wari is passed to
contrib/ari/gdb_ari.sh
gdb/ChangeLog:
* arc-tdep.c: Fix ARI warning for printf(%p).
Diff:
---
gdb/ChangeLog | 4 ++++
gdb/arc-tdep.c | 5 +++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1d1908b..8215c41 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2016-09-22 Anton Kolesov <anton.kolesov@synopsys.com>
+
+ * arc-tdep.c: Fix ARI warning for printf(%p).
+
2016-09-21 Anton Kolesov <anton.kolesov@synopsys.com>
* MAINTAINERS (Write After Approval): Add Anton Kolesov.
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index 6048ad6..7bb93ad 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -574,8 +574,9 @@ arc_return_value (struct gdbarch *gdbarch, struct value *function,
|| TYPE_LENGTH (valtype) > 2 * ARC_REGISTER_SIZE);
if (arc_debug)
- debug_printf ("arc: return_value (readbuf = %p, writebuf = %p)\n",
- readbuf, writebuf);
+ debug_printf ("arc: return_value (readbuf = %s, writebuf = %s)\n",
+ host_address_to_string (readbuf),
+ host_address_to_string (writebuf));
if (writebuf != NULL)
{