Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1587308

Re: [PATCH 4/4] perf annotate: Introduce source_code to collect actual code

From Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 4/4] perf annotate: Introduce source_code to collect actual code
Date 2017-02-24 07:00 +0100
Message-ID <teh57-47A-1@gated-at.bofh.it> (permalink)
References <tdC1X-8u2-3@gated-at.bofh.it> <tdC1Y-8u2-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Taeung,

On Wednesday 22 February 2017 03:38 PM, Taeung Song wrote:
> +	INIT_LIST_HEAD(&notes->src->code);
> +
> +	while (!feof(file)) {
> +		int nr;
> +		char *c, *parsed_line;
> +		struct source_code *code;
> +
> +		if (getline(&line, &len, file) < 0) {
> +			symbol__free_source_code(sym);
> +			break;
> +		}
> +
> +		if (++nr < first_linenr)

Please initialize variable nr. I got a compilation error:

util/annotate.c: In function ‘symbol__tty_annotate’:
util/annotate.c:1674:6: error: ‘nr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   if (++nr < first_linenr)
      ^
util/annotate.c:1665:7: note: ‘nr’ was declared here
   int nr;
       ^

Ravi

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] perf annotate: Fixes for line numbers and Introduce source_code Taeung Song <treeze.taeung@gmail.com> - 2017-02-22 11:10 +0100
  [PATCH 1/4] perf annotate: Remove needless regular expression for filename:linenr Taeung Song <treeze.taeung@gmail.com> - 2017-02-22 11:10 +0100
    Re: [PATCH 1/4] perf annotate: Remove needless regular expression for filename:linenr Namhyung Kim <namhyung@kernel.org> - 2017-02-22 11:50 +0100
      Re: [PATCH 1/4] perf annotate: Remove needless regular expression for  filename:linenr Taeung Song <treeze.taeung@gmail.com> - 2017-02-22 17:20 +0100
  [PATCH 4/4] perf annotate: Introduce source_code to collect actual code Taeung Song <treeze.taeung@gmail.com> - 2017-02-22 11:10 +0100
    Re: [PATCH 4/4] perf annotate: Introduce source_code to collect  actual code Namhyung Kim <namhyung@kernel.org> - 2017-02-22 12:30 +0100
      Re: [PATCH 4/4] perf annotate: Introduce source_code to collect  actual code Taeung Song <treeze.taeung@gmail.com> - 2017-02-22 17:50 +0100
    Re: [PATCH 4/4] perf annotate: Introduce source_code to collect  actual code Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2017-02-24 07:00 +0100

csiph-web