From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Jiri Olsa <jolsa@redhat.com>, LKML <linux-kernel@vger.kernel.org>,
David Ahern <dsahern@gmail.com>, Wang Nan <wangnan0@huawei.com>
Subject: Re: [PATCH] tools/lib/bpf: Fix compiler warning on CentOS 6
Date: Tue, 3 Nov 2015 12:13:18 -0300 [thread overview]
Message-ID: <20151103151318.GN21609@kernel.org> (raw)
In-Reply-To: <1446549665-2342-1-git-send-email-namhyung@kernel.org>
Em Tue, Nov 03, 2015 at 08:21:05PM +0900, Namhyung Kim escreveu:
> CC libbpf.o
> cc1: warnings being treated as errors
> libbpf.c: In function 'bpf_program__title':
> libbpf.c:1037: error: declaration of 'dup' shadows a global declaration
> /usr/include/unistd.h:528: error: shadowed declaration is here
> mv: cannot stat `./.libbpf.o.tmp': No such file or directory
> make[3]: *** [libbpf.o] Error 1
> make[2]: *** [libbpf-in.o] Error 2
> make[1]: *** [/linux/tools/lib/bpf/libbpf.a] Error 2
> make[1]: *** Waiting for unfinished jobs....
Thanks, applied.
- Arnaldo
> Cc: Wang Nan <wangnan0@huawei.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
> tools/lib/bpf/libbpf.c | 4 ++--
> tools/lib/bpf/libbpf.h | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index 4252fc22f78f..9f3c8cf9249b 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -1034,12 +1034,12 @@ int bpf_program__get_private(struct bpf_program *prog, void **ppriv)
> return 0;
> }
>
> -const char *bpf_program__title(struct bpf_program *prog, bool dup)
> +const char *bpf_program__title(struct bpf_program *prog, bool needs_copy)
> {
> const char *title;
>
> title = prog->section_name;
> - if (dup) {
> + if (needs_copy) {
> title = strdup(title);
> if (!title) {
> pr_warning("failed to strdup program title\n");
> diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
> index f16170c95ffd..bc80af03c6f4 100644
> --- a/tools/lib/bpf/libbpf.h
> +++ b/tools/lib/bpf/libbpf.h
> @@ -63,7 +63,7 @@ int bpf_program__set_private(struct bpf_program *prog, void *priv,
> int bpf_program__get_private(struct bpf_program *prog,
> void **ppriv);
>
> -const char *bpf_program__title(struct bpf_program *prog, bool dup);
> +const char *bpf_program__title(struct bpf_program *prog, bool needs_copy);
>
> int bpf_program__fd(struct bpf_program *prog);
>
> --
> 2.6.2
next prev parent reply other threads:[~2015-11-03 15:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 11:21 [PATCH] tools/lib/bpf: Fix compiler warning on CentOS 6 Namhyung Kim
2015-11-03 15:13 ` Arnaldo Carvalho de Melo [this message]
2015-11-08 7:28 ` [tip:perf/urgent] tools lib bpf: " tip-bot for Namhyung Kim
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=20151103151318.GN21609@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=dsahern@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=wangnan0@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox