mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-19 04:42:35 -04:00
Merge branch 'bpf-selftests-fixes-for-gcc-bpf-16'
Jose E. Marchesi says: ==================== bpf: selftests fixes for GCC-BPF 16 Hello. Just a couple of small fixes to get the BPF selftests build with what will become GCC 16 this spring. One of the regressions is due to a change in the behavior of a warning in GCC 16. The other is due to the fact that GCC 16 actually implements btf_decl_tag and btf_type_tag. Salud! ==================== Link: https://patch.msgid.link/20260106173650.18191-1-jose.marchesi@oracle.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
@@ -7,6 +7,16 @@
|
||||
|
||||
#define MAX_ENTRIES 8
|
||||
|
||||
/* clang considers 'sum += 1' as usage but 'sum++' as non-usage. GCC
|
||||
* is more consistent and considers both 'sum += 1' and 'sum++' as
|
||||
* non-usage. This triggers warnings in the functions below.
|
||||
*
|
||||
* Starting with GCC 16 -Wunused-but-set-variable=2 can be used to
|
||||
* mimic clang's behavior. */
|
||||
#if !defined(__clang__) && __GNUC__ > 15
|
||||
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
||||
#endif
|
||||
|
||||
struct map_value {
|
||||
struct bpf_timer timer;
|
||||
};
|
||||
|
||||
@@ -7,6 +7,16 @@
|
||||
#include "bpf_tracing_net.h"
|
||||
#include "bpf_misc.h"
|
||||
|
||||
/* clang considers 'sum += 1' as usage but 'sum++' as non-usage. GCC
|
||||
* is more consistent and considers both 'sum += 1' and 'sum++' as
|
||||
* non-usage. This triggers warnings in the functions below.
|
||||
*
|
||||
* Starting with GCC 16 -Wunused-but-set-variable=2 can be used to
|
||||
* mimic clang's behavior. */
|
||||
#if !defined(__clang__) && __GNUC__ > 15
|
||||
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
||||
#endif
|
||||
|
||||
char _license[] SEC("license") = "GPL";
|
||||
|
||||
struct {
|
||||
|
||||
@@ -33,7 +33,7 @@ struct {
|
||||
} hashmap1 SEC(".maps");
|
||||
|
||||
|
||||
static __noinline int foo(int x __tag1 __tag2) __tag1 __tag2
|
||||
static __noinline __tag1 __tag2 int foo(int x __tag1 __tag2)
|
||||
{
|
||||
struct key_t key;
|
||||
value_t val = {};
|
||||
|
||||
Reference in New Issue
Block a user