From 55632770d7298835645489828af87f854c47749c Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Thu, 18 Mar 2010 16:51:16 +0100 Subject: [PATCH] perf events: Fix false positive build warning with older GCC's gcc 4.2.1 produces: util/probe-event.c: In function 'add_perf_probe_events': util/probe-event.c:883: warning: 'tev' may be used uninitialized in this function make: *** [util/probe-event.o] Error 1 Newer GCCs get this right. To work it around, initialize the variable to NULL so that older GCCs see it as initialized too. Cc: Masami Hiramatsu Cc: Frederic Weisbecker Cc: Arnaldo Carvalho de Melo Cc: Paul Mackerras Cc: Mike Galbraith Cc: Peter Zijlstra LKML-Reference: <20100316220612.32050.33806.stgit@localhost6.localdomain6> Signed-off-by: Ingo Molnar --- tools/perf/util/probe-event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index f333269..c6603f3 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -880,7 +880,7 @@ static void __add_kprobe_trace_events(struct perf_probe_event *pev, int ntevs, bool allow_suffix) { int i, fd; - struct kprobe_trace_event *tev; + struct kprobe_trace_event *tev = NULL; char buf[64]; const char *event, *group; struct strlist *namelist; -- 1.8.2.3