diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index d42b495b099278cc7a96b4dc0945d56c38c06287..6c7468eb3684494b46a248fcef39a1e451fd6856 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -189,4 +189,5 @@ $(obj)/%.o: $(src)/%.c -Wno-compare-distinct-pointer-types \ -Wno-gnu-variable-sized-type-not-at-end \ -Wno-address-of-packed-member -Wno-tautological-compare \ + -Wno-unknown-warning-option \ -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@ diff --git a/samples/bpf/cookie_uid_helper_example.c b/samples/bpf/cookie_uid_helper_example.c index ad5afedf2e7047db24db8565e0a433122e479912..9ce55840d61d222ec2c9881be9a108c7b630dba0 100644 --- a/samples/bpf/cookie_uid_helper_example.c +++ b/samples/bpf/cookie_uid_helper_example.c @@ -273,7 +273,7 @@ static int usage(void) return 1; } -void finish(int ret) +static void finish(int ret) { test_finish = true; } diff --git a/samples/bpf/test_lru_dist.c b/samples/bpf/test_lru_dist.c index d96dc88d3b04067135fe80c95628fca37a29c022..73c35714226842b248027b214989e56570e4378f 100644 --- a/samples/bpf/test_lru_dist.c +++ b/samples/bpf/test_lru_dist.c @@ -25,7 +25,9 @@ #include "bpf_util.h" #define min(a, b) ((a) < (b) ? (a) : (b)) -#define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER) +#ifndef offsetof +# define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER) +#endif #define container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );})