All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Paul Chaignon <paul.chaignon@orange.com>
Cc: bpf@vger.kernel.org, paul.chaignon@gmail.com,
	netdev@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>, Andrii Nakryiko <andriin@fb.com>
Subject: Re: [PATCH bpf-next] bpftool: Fix compilation warning on shadowed variable
Date: Mon, 16 Dec 2019 14:24:40 +0100	[thread overview]
Message-ID: <20191216132440.GC14887@linux.fritz.box> (raw)
In-Reply-To: <20191216112733.GA28366@Omicron>

On Mon, Dec 16, 2019 at 12:27:33PM +0100, Paul Chaignon wrote:
> The ident variable has already been declared at the top of the function
> and doesn't need to be re-declared.
> 
> Fixes: 985ead416df39 ("bpftool: Add skeleton codegen command")
> Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>

One warning and one error in today's bpf-next tree's tooling. :/ This fixes
the former, applied, thanks!

[root@linux bpftool]# make

Auto-detecting system features:
...                        libbfd: [ on  ]
...        disassembler-four-args: [ on  ]
...                          zlib: [ on  ]

  CC       map_perf_ring.o
  CC       xlated_dumper.o
  CC       btf.o
  CC       tracelog.o
  CC       perf.o
  CC       cfg.o
  CC       btf_dumper.o
  CC       net.o
  CC       netlink_dumper.o
  CC       common.o
  CC       cgroup.o
  CC       gen.o
gen.c: In function ‘do_skeleton’:
gen.c:391:16: warning: declaration of ‘ident’ shadows a previous local [-Wshadow]
  391 |    const char *ident = get_map_ident(map);
      |                ^~~~~
gen.c:266:21: note: shadowed declaration is here
  266 |  const char *file, *ident;
      |                     ^~~~~
  CC       main.o
  CC       json_writer.o
  CC       prog.o
  CC       map.o
  CC       feature.o
  CC       jit_disasm.o
  CC       disasm.o
make[1]: Entering directory '/home/darkstar/trees/bpf-next/tools/lib/bpf'

Auto-detecting system features:
...                        libelf: [ on  ]
...                          zlib: [ on  ]
...                           bpf: [ on  ]

Parsed description of 117 helper function(s)
  MKDIR    staticobjs/
  CC       staticobjs/libbpf.o
  CC       staticobjs/bpf.o
  CC       staticobjs/nlattr.o
  CC       staticobjs/btf.o
btf.c: In function ‘btf__align_of’:
btf.c:303:21: error: declaration of ‘t’ shadows a previous local [-Werror=shadow]
  303 |   int i, align = 1, t;
      |                     ^
btf.c:283:25: note: shadowed declaration is here
  283 |  const struct btf_type *t = btf__type_by_id(btf, id);
      |                         ^
cc1: all warnings being treated as errors
  CC       staticobjs/libbpf_errno.o
  CC       staticobjs/str_error.o
  CC       staticobjs/netlink.o
  CC       staticobjs/bpf_prog_linfo.o
  CC       staticobjs/libbpf_probes.o
  CC       staticobjs/xsk.o
  CC       staticobjs/hashmap.o
  CC       staticobjs/btf_dump.o
  LD       staticobjs/libbpf-in.o
ld: cannot find staticobjs/btf.o: No such file or directory
make[2]: *** [/home/darkstar/trees/bpf-next/tools/build/Makefile.build:145: staticobjs/libbpf-in.o] Error 1
make[1]: *** [Makefile:182: staticobjs/libbpf-in.o] Error 2
make[1]: Leaving directory '/home/darkstar/trees/bpf-next/tools/lib/bpf'
make: *** [Makefile:32: /home/darkstar/trees/bpf-next/tools/lib/bpf/libbpf.a] Error 2


      reply	other threads:[~2019-12-16 13:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16 11:27 [PATCH bpf-next] bpftool: Fix compilation warning on shadowed variable Paul Chaignon
2019-12-16 13:24 ` Daniel Borkmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191216132440.GC14887@linux.fritz.box \
    --to=daniel@iogearbox.net \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=kafai@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=paul.chaignon@gmail.com \
    --cc=paul.chaignon@orange.com \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.