From d3e1afacaa0a2b174bcecce5a061dda1eab4df91 Mon Sep 17 00:00:00 2001 From: normal Date: Sat, 13 Oct 2018 05:36:50 +0000 Subject: [PATCH] addr2line.c: fix *printf type warnings on 32-bit Yup, back to using an ancient 32-bit system... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- addr2line.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/addr2line.c b/addr2line.c index 3cf73de098..c48e1ed06c 100644 --- a/addr2line.c +++ b/addr2line.c @@ -814,25 +814,27 @@ next_line: uintptr_t addr = (uintptr_t)traces[i]; uintptr_t d = addr - line->saddr; if (!line->path) { - kprintf("[0x%lx]\n", addr); + kprintf("[0x%"PRIuPTR"]\n", addr); } else if (!line->saddr || !line->sname) { - kprintf("%s(0x%lx) [0x%lx]\n", line->path, addr-line->base_addr, addr); + kprintf("%s(0x%"PRIuPTR") [0x%"PRIuPTR"]\n", line->path, addr-line->base_addr, addr); } else if (line->line <= 0) { - kprintf("%s(%s+0x%lx) [0x%lx]\n", line->path, line->sname, + kprintf("%s(%s+0x%"PRIuPTR") [0x%"PRIuPTR"]\n", line->path, line->sname, d, addr); } else if (!line->filename) { - kprintf("%s(%s+0x%lx) [0x%lx] ???:%d\n", line->path, line->sname, - d, addr, line->line); + kprintf("%s(%s+0x%"PRIuPTR") [0x%"PRIuPTR"] ???:%d\n", + line->path, line->sname, d, addr, line->line); } else if (line->dirname && line->dirname[0]) { - kprintf("%s(%s+0x%lx) [0x%lx] %s/%s:%d\n", line->path, line->sname, + kprintf("%s(%s+0x%"PRIuPTR") [0x%"PRIuPTR"] %s/%s:%d\n", + line->path, line->sname, d, addr, line->dirname, line->filename, line->line); } else { - kprintf("%s(%s+0x%lx) [0x%lx] %s:%d\n", line->path, line->sname, + kprintf("%s(%s+0x%"PRIuPTR") [0x%"PRIuPTR"] %s:%d\n", + line->path, line->sname, d, addr, line->filename, line->line); } /* FreeBSD's backtrace may show _start and so on */