lkml.org 
[lkml]   [2021]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] tools/perf: Do not set a variable unless it will be used
Hi Peter

On Tue, 8 Jun 2021 at 13:29, Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Fri, Jun 04, 2021 at 09:24:23PM +0200, Ricardo Ribalda wrote:
> > Hi Peter
> >
> > On Fri, 4 Jun 2021 at 11:36, Peter Zijlstra <peterz@infradead.org> wrote:
> > >
> > > On Fri, Jun 04, 2021 at 11:26:38AM +0200, Ricardo Ribalda wrote:
> > > > clang-13 triggers the following warning:
> > > >
> > > > bench/inject-buildid.c:351:6: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable]
> clue here: ^^^^^^^^^^^^^
>
> > > > u64 len = 0;
> > > >
> > > > This patch sets the value to len only if it will be used afterwards.
> > >
> > > My vote would be to kill that warning, what absolute shite.
> >
> > My knowledge of llvm codebase is close to NULL, so it is much easier
> > for me to "fix" the code.
>
> That's what -Wno-unused-but-set-variable is for, which is trivial to add
> to the Makefile.

Yes, that is quite easy to add, the problem is that we might hide real
bugs. I completely agree that this one is borderline :)



--
Ricardo Ribalda

\
 
 \ /
  Last update: 2021-06-09 16:17    [W:1.580 / U:0.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site