lkml.org 
[lkml]   [2009]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf_event: fix compile error

* Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> wrote:

> Ingo Molnar wrote:
> > * Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> wrote:
> >
> >> cc1: warnings being treated as errors
> >> builtin-probe.c: In function ???cmd_probe???:
> >> builtin-probe.c:163: error: unused variable ???fd???
> >>
> >> Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
> >> ---
> >> tools/perf/builtin-probe.c | 3 ++-
> >> 1 files changed, 2 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
> >> index b5d15cf..64ea038 100644
> >> --- a/tools/perf/builtin-probe.c
> >> +++ b/tools/perf/builtin-probe.c
> >> @@ -160,7 +160,8 @@ static const struct option options[] = {
> >>
> >> int cmd_probe(int argc, const char **argv, const char *prefix __used)
> >> {
> >> - int i, j, fd, ret;
> >> + int i, j, ret;
> >> + int fd __used;
> >> struct probe_point *pp;
> >
> > i think it's better to initialize it to -1 instead of turning off the
> > warning.
> >
>
> Hi Ingo,
>
> I have try this way but the error still exists :-(

ah - unused, not uninitialized.

Then the right fix is to use NO_LIBDWARF, not __used annotation. I've
changed it to that and committed your fix - thanks!

Ingo


\
 
 \ /
  Last update: 2009-12-02 09:31    [W:0.185 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site