[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEf4BzbYv7Yr79KgbO2fXffDpiYa5-Nq1_1CnKoXbKTF_yJ75g@mail.gmail.com>
Date: Wed, 29 Apr 2020 19:13:52 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Yuehaibing <yuehaibing@...wei.com>
Cc: Andrii Nakryiko <andriin@...com>, bpf <bpf@...r.kernel.org>,
Networking <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...com>,
Daniel Borkmann <daniel@...earbox.net>,
Kernel Team <kernel-team@...com>
Subject: Re: [PATCH bpf-next] libbpf: fix false unused variable warning
On Wed, Apr 29, 2020 at 6:52 PM Yuehaibing <yuehaibing@...wei.com> wrote:
>
> On 2020/4/30 9:25, Andrii Nakryiko wrote:
> > Some versions of GCC falsely detect that vi might not be initialized. That's
> > not true, but let's silence it with NULL initialization.
> >
>
> Title should be fixed 'unused' --> 'uninitialized' ?
Yep, my bad, will send v2 with correction.
>
> > Signed-off-by: Andrii Nakryiko <andriin@...com>
> > ---
> > tools/lib/bpf/libbpf.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> > index d86ff8214b96..977add1b73e2 100644
> > --- a/tools/lib/bpf/libbpf.c
> > +++ b/tools/lib/bpf/libbpf.c
> > @@ -5003,8 +5003,8 @@ static int bpf_object__collect_map_relos(struct bpf_object *obj,
> > GElf_Shdr *shdr, Elf_Data *data)
> > {
> > int i, j, nrels, new_sz, ptr_sz = sizeof(void *);
> > + const struct btf_var_secinfo *vi = NULL;
> > const struct btf_type *sec, *var, *def;
> > - const struct btf_var_secinfo *vi;
> > const struct btf_member *member;
> > struct bpf_map *map, *targ_map;
> > const char *name, *mname;
> >
>
Powered by blists - more mailing lists