Patchworkβ [1/1] perf probe: Annotate variable initialization

login
register
about
Submitter Arnaldo Carvalho de Melo
Date 2009-11-03 13:29:07
Message ID <1257254947-16789-1-git-send-email-acme@infradead.org>
Download mbox | patch
Permalink /patch/57303/
State New
Headers show

Comments

Arnaldo Carvalho de Melo - 2009-11-03 13:29:07
From: Arnaldo Carvalho de Melo <acme@redhat.com>

    cc1: warnings being treated as errors
    builtin-probe.c: In function ‘parse_probe_event’:
    builtin-probe.c:72: warning: ‘nc’ is used uninitialized in this function

Cc: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-probe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Masami Hiramatsu - 2009-11-03 15:46:21
Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo<acme@redhat.com>
>
>      cc1: warnings being treated as errors
>      builtin-probe.c: In function ‘parse_probe_event’:
>      builtin-probe.c:72: warning: ‘nc’ is used uninitialized in this function
>
> Cc: Masami Hiramatsu<mhiramat@redhat.com>
> Signed-off-by: Arnaldo Carvalho de Melo<acme@redhat.com>

Oops, thank you!

Acked-by: Masami Hiramatsu <mhiramat@redhat.com>

> ---
>   tools/perf/builtin-probe.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
> index a99a366..8124523 100644
> --- a/tools/perf/builtin-probe.c
> +++ b/tools/perf/builtin-probe.c
> @@ -69,7 +69,7 @@ static struct {
>   static void parse_probe_point(char *arg, struct probe_point *pp)
>   {
>   	char *ptr, *tmp;
> -	char c, nc;
> +	char c, nc = 0;
>   	/*
>   	 *<Syntax>
>   	* perf probe SRC:LN

Patch

diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index a99a366..8124523 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -69,7 +69,7 @@  static struct {
 static void parse_probe_point(char *arg, struct probe_point *pp)
 {
 	char *ptr, *tmp;
-	char c, nc;
+	char c, nc = 0;
 	/*
 	 * <Syntax>
 	 * perf probe SRC:LN