提交 a949fffb 编写于 作者: D David Ahern 提交者: Arnaldo Carvalho de Melo

perf tools: Fix old GCC build error in 'get_srcline'

trace-event-parse.c:parse_proc_kallsyms()

    Old GCC (4.4.2) does not see through the code flow of get_srcline() and
gets confused about the status of 'file' and 'line':

    CC       /tmp/build/perf/util/srcline.o
  cc1: warnings being treated as errors
  util/srcline.c: In function ¿get_srcline¿:
  util/srcline.c:226: error: ¿file¿ may be used uninitialized in this function
  util/srcline.c:227: error: ¿line¿ may be used uninitialized in this function
  make[1]: *** [/tmp/build/perf/util/srcline.o] Error 1
  make: *** [install] Error 2
  make: Leaving directory `/home/acme/git/linux/tools/perf'
  [acme@fedora12 linux]$

Help out GCC by initializing 'file' and 'line'.
Signed-off-by: NDavid Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Link: http://lkml.kernel.org/n/tip-h8k7h49z3cndqgjdftkmm9f8@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 bf2575c1
...@@ -223,8 +223,8 @@ static int addr2line(const char *dso_name, unsigned long addr, ...@@ -223,8 +223,8 @@ static int addr2line(const char *dso_name, unsigned long addr,
char *get_srcline(struct dso *dso, unsigned long addr) char *get_srcline(struct dso *dso, unsigned long addr)
{ {
char *file; char *file = NULL;
unsigned line; unsigned line = 0;
char *srcline; char *srcline;
char *dso_name = dso->long_name; char *dso_name = dso->long_name;
size_t size; size_t size;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册