aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Zagorui <dzagorui@cisco.com>2023-09-07 02:02:10 -0700
committerQuentin Monnet <qmonnet+github@qoba.lt>2023-09-26 11:17:14 +0200
commit24f4661afc38dfc3597489b5689a195697ab59a9 (patch)
tree8a4d6bcadfd5f415e3678371779736621d509236
parent88ab799f1542379eb4fc90a24433c44bf6259ad9 (diff)
downloadbpftool-24f4661afc38dfc3597489b5689a195697ab59a9.tar.gz
bpftool: Fix -Wcast-qual warning
This cast was made by purpose for older libbpf where the bpf_object_skeleton field is void * instead of const void * to eliminate a warning (as i understand -Wincompatible-pointer-types-discards-qualifiers) but this cast introduces another warning (-Wcast-qual) for libbpf where data field is const void * It makes sense for bpftool to be in sync with libbpf from kernel sources Signed-off-by: Denys Zagorui <dzagorui@cisco.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Quentin Monnet <quentin@isovalent.com> Link: https://lore.kernel.org/bpf/20230907090210.968612-1-dzagorui@cisco.com
-rw-r--r--src/gen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gen.c b/src/gen.c
index 2883660..04c4774 100644
--- a/src/gen.c
+++ b/src/gen.c
@@ -1209,7 +1209,7 @@ static int do_skeleton(int argc, char **argv)
codegen("\
\n\
\n\
- s->data = (void *)%2$s__elf_bytes(&s->data_sz); \n\
+ s->data = %2$s__elf_bytes(&s->data_sz); \n\
\n\
obj->skeleton = s; \n\
return 0; \n\