tools/lib/bpf: Fix compiler warning on CentOS 6
PATCH 1/1 tools/lib/bpf: Fix compiler warning on CentOS 6
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....
--- tools/lib/bpf/libbpf.c | 4 ++-- tools/lib/bpf/libbpf.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
tools/lib/bpf/libbpf.c +2 -2
@@ -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" );
tools/lib/bpf/libbpf.h +1 -1
@@ -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);
Signature · 1 line
2.6.2
Arnaldo Carvalho de Melo
AppliedEm Tue, Nov 03, 2015 at 08:21:05PM +0900, Namhyung Kim escreveu:
Quoted 10 lines
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
Quoted 41 lines
Cc Wang Nan <[email protected]>Signed-off-by Namhyung Kim <[email protected]>--- tools/lib/bpf/libbpf.c | 4 ++-- tools/lib/bpf/libbpf.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)tools/lib/bpf/libbpf.c +2
-2@@ -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" );tools/lib/bpf/libbpf.h +1
-1@@ -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);Signature · 1 line
2.6.2
tip-bot for Namhyung Kim
merge bot[tip:perf/urgent] tools lib bpf: Fix compiler warning on CentOS 6
In reply to Namhyung Kimtools lib bpf: Fix compiler warning on CentOS 6
Commit-ID: 715f8db9102f1ab40ea4a87bedfe86399323698f Gitweb: http://git.kernel.org/tip/715f8db9102f1ab40ea4a87bedfe86399323698f Author: Namhyung Kim <[email protected]> AuthorDate: Tue, 3 Nov 2015 20:21:05 +0900 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 3 Nov 2015 12:13:31 -0300
tools lib bpf: Fix compiler warning on CentOS 6
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....
--- tools/lib/bpf/libbpf.c | 4 ++-- tools/lib/bpf/libbpf.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
tools/lib/bpf/libbpf.c +2 -2
@@ -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" );
tools/lib/bpf/libbpf.h +1 -1
@@ -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);