From af0e536d034a712c8de3d92f9bb3bfb730795d27 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Sun, 16 Sep 2018 13:22:00 +0000 Subject: addr2line.c: fix -Wmaybe-uninitialized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../addr2line.c: In function ‘fill_lines’: ../addr2line.c:709:8: warning: ‘file’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (file != NULL) { ^ ../addr2line.c:535:11: warning: ‘filesize’ may be used uninitialized in this function [-Wmaybe-uninitialized] off_t filesize; ^~~~~~~~ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- addr2line.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addr2line.c b/addr2line.c index b266e44d5d..9220a0e0f6 100644 --- a/addr2line.c +++ b/addr2line.c @@ -532,8 +532,8 @@ fill_lines(int num_traces, void **traces, int check_debuglink, ElfW(Shdr) *shdr, *shstr_shdr; ElfW(Shdr) *debug_line_shdr = NULL, *gnu_debuglink_shdr = NULL; int fd; - off_t filesize; - char *file; + off_t filesize = 0; + char *file = NULL; ElfW(Shdr) *symtab_shdr = NULL, *strtab_shdr = NULL; ElfW(Shdr) *dynsym_shdr = NULL, *dynstr_shdr = NULL; obj_info_t *obj = *objp; -- cgit v1.2.3