Messages in this thread Patch in this message | | | From | chenggang qin <> | Subject | [PATCH] perf/core: Fix a warning in util/trace-event-parse.c | Date | Sun, 7 Apr 2013 17:36:58 +0800 |
| |
From: <chenggang.qcg@taobao.com>
While I compile the perf in Red Hat Enterprise Linux Server release 5.4 (Tikanga), I got a warning:
CC util/trace-event-parse.o cc1: warnings being treated as errors util/trace-event-parse.c: In function 'parse_proc_kallsyms': util/trace-event-parse.c:232: warning: 'fmt' may be used uninitialized in this function make: *** [util/trace-event-parse.o] Error 1
The version of gcc is: 4.1.2
The reason is that the local variable 'fmt' is not initialized before we use it. It is fixed in this patch.
Cc: David Ahern <dsahern@gmail.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Yanmin Zhang <yanmin.zhang@intel.com> Cc: Wu Fengguang <fengguang.wu@intel.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Chenggang Qin <chenggang.qcg@taobao.com>
--- tools/perf/util/trace-event-parse.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index 3aabcd6..630e331 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c @@ -229,7 +229,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) { -- 1.5.5.6
| |