Skip to content

Commit

Permalink
perf tools: Fix old GCC build error in trace-event-parse.c:parse_proc…
Browse files Browse the repository at this point in the history
…_kallsyms()

Old GCC (4.1) does not see through the code flow of parse_proc_kallsyms()
and gets confused about the status of 'fmt':

 util/trace-event-parse.c: In function ‘parse_proc_kallsyms’:
 util/trace-event-parse.c:189: warning: ‘fmt’ may be used uninitialized in this function
 make: *** [util/trace-event-parse.o] Error 1

Help out GCC by initializing 'fmt' to NULL.

Signed-off-by: Ingo Molnar <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
Ingo Molnar authored and acmel committed Sep 19, 2013
1 parent 0dbb1ca commit 0f96542
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/util/trace-event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void parse_proc_kallsyms(struct pevent *pevent,
char *next = NULL;
char *addr_str;
char *mod;
char *fmt;
char *fmt = NULL;

line = strtok_r(file, "\n", &next);
while (line) {
Expand Down

0 comments on commit 0f96542

Please sign in to comment.