]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Suppress compiler warning when using SEC() macro with externs
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 23 Apr 2021 18:13:33 +0000 (11:13 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 23 Apr 2021 21:05:26 +0000 (14:05 -0700)
commit12e5d6a972ab25cb233bb793606ae346dbacd469
tree819ff515663653459f53849db97538345e828e29
parenta541d01bed7ba7ac7f8884ad0bc233bca31b2e64
libbpf: Suppress compiler warning when using SEC() macro with externs

When used on externs SEC() macro will trigger compilation warning about
inapplicable `__attribute__((used))`. That's expected for extern declarations,
so suppress it with the corresponding _Pragma.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210423181348.1801389-4-andrii@kernel.org
tools/lib/bpf/bpf_helpers.h