public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Steven Rostedt <srostedt@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH] perf tools: Shut up compiler warning
Date: Tue, 20 Oct 2009 07:54:39 +0200	[thread overview]
Message-ID: <20091020055439.GA29531@elte.hu> (raw)
In-Reply-To: <1255971369-11368-1-git-send-email-acme@redhat.com>


* Arnaldo Carvalho de Melo <acme@redhat.com> wrote:

> cc1: warnings being treated as errors
> util/trace-event-parse.c: In function ‘parse_ftrace_printk’:
> util/trace-event-parse.c:289: warning: ‘fmt’ may be used uninitialized in this function
> 
> Cc: Steven Rostedt <srostedt@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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 4b61b49..0b8a01b 100644
> --- a/tools/perf/util/trace-event-parse.c
> +++ b/tools/perf/util/trace-event-parse.c
> @@ -286,7 +286,7 @@ void parse_ftrace_printk(char *file, unsigned int size __unused)
>  	char *line;
>  	char *next = NULL;
>  	char *addr_str;
> -	char *fmt;
> +	char *fmt = NULL;
>  	int i;
>  
>  	line = strtok_r(file, "\n", &next);

Actually, this might be a real bug that GCC pointed out: what makes sure 
that strtok_r() does not return a NULL (no more tokens) and hence fmt 
remains NULL (crashing the rest of the parser)?

	Ingo

  reply	other threads:[~2009-10-20  5:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-19 16:56 [PATCH] perf tools: Shut up compiler warning Arnaldo Carvalho de Melo
2009-10-20  5:54 ` Ingo Molnar [this message]
2009-10-20 13:19   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091020055439.GA29531@elte.hu \
    --to=mingo@elte.hu \
    --cc=acme@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=srostedt@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox