ruby-changes:52550
From: k0kubun <ko1@a...>
Date: Sun, 16 Sep 2018 22:22:06 +0900 (JST)
Subject: [ruby-changes:52550] k0kubun:r64762 (trunk): addr2line.c: fix -Wmaybe-uninitialized
k0kubun 2018-09-16 22:22:00 +0900 (Sun, 16 Sep 2018) New Revision: 64762 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64762 Log: addr2line.c: fix -Wmaybe-uninitialized ../addr2line.c: In function ?\226?\128?\152fill_lines?\226?\128?\153: ../addr2line.c:709:8: warning: ?\226?\128?\152file?\226?\128?\153 may be used uninitialized in this function [-Wmaybe-uninitialized] if (file != NULL) { ^ ../addr2line.c:535:11: warning: ?\226?\128?\152filesize?\226?\128?\153 may be used uninitialized in this function [-Wmaybe-uninitialized] off_t filesize; ^~~~~~~~ Modified files: trunk/addr2line.c Index: addr2line.c =================================================================== --- addr2line.c (revision 64761) +++ addr2line.c (revision 64762) @@ -532,8 +532,8 @@ fill_lines(int num_traces, void **traces https://github.com/ruby/ruby/blob/trunk/addr2line.c#L532 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/