From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751298AbdBXF6G (ORCPT ); Fri, 24 Feb 2017 00:58:06 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44562 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750873AbdBXF57 (ORCPT ); Fri, 24 Feb 2017 00:57:59 -0500 Subject: Re: [PATCH 4/4] perf annotate: Introduce source_code to collect actual code To: Taeung Song References: <1487758103-7953-1-git-send-email-treeze.taeung@gmail.com> <1487758103-7953-5-git-send-email-treeze.taeung@gmail.com> Cc: Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Jiri Olsa , Namhyung Kim , Ingo Molnar , Peter Zijlstra , Wang Nan , Masami Hiramatsu , Jiri Olsa , Ravi Bangoria From: Ravi Bangoria Date: Fri, 24 Feb 2017 11:27:42 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1487758103-7953-5-git-send-email-treeze.taeung@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022405-0024-0000-0000-000015FDA226 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006673; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000204; SDB=6.00826311; UDB=6.00404689; IPR=6.00603763; BA=6.00005168; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014420; XFM=3.00000011; UTC=2017-02-24 05:57:56 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022405-0025-0000-0000-00004903D0AC Message-Id: <58AFCB56.1020502@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-24_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702240061 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Taeung, On Wednesday 22 February 2017 03:38 PM, Taeung Song wrote: > + INIT_LIST_HEAD(¬es->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