lkml.org 
[lkml]   [2013]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Fix old GCC build error in perf/util/trace-event-parse.c:parse_proc_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.

Thanks,

Ingo

Signed-off-by: Ingo Molnar <mingo@kernel.org>

diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index fe7a27d..e9e1c03 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -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) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2013-09-12 15:41    [W:0.083 / U:0.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site