[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiDSCu4Brz7FZX5oa57kNLG9h_1EASX=bdQij4+apg0ZwW8QA@mail.gmail.com>
Date: Fri, 4 Jun 2021 21:24:23 +0200
From: Ricardo Ribalda <ribalda@...omium.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-perf-users@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>
Subject: Re: [PATCH] tools/perf: Do not set a variable unless it will be used
Hi Peter
On Fri, 4 Jun 2021 at 11:36, Peter Zijlstra <peterz@...radead.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]
> > 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.
I would assume that the static analyser has found a magic condition
where the previous if always returns false, and has managed to
"optimize" the code.
--
Ricardo Ribalda
Powered by blists - more mailing lists