Skip to content

Commit 13c9b70

Browse files
2005songliweiborkmann
authored andcommitted
tools/resolve_btfids: Fix comparison of distinct pointer types warning in resolve_btfids
Add a type cast for set8->pairs to fix below compile warning: main.c: In function 'sets_patch': main.c:699:50: warning: comparison of distinct pointer types lacks a cast 699 | BUILD_BUG_ON(set8->pairs != &set8->pairs[0].id); | ^~ Fixes: 9707ac4 ("tools/resolve_btfids: Refactor set sorting with types from btf_ids.h") Signed-off-by: Liwei Song <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Jiri Olsa <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 0be9ae5 commit 13c9b70

File tree

1 file changed

+1
-1
lines changed
  • tools/bpf/resolve_btfids

1 file changed

+1
-1
lines changed

tools/bpf/resolve_btfids/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ static int sets_patch(struct object *obj)
704704
* Make sure id is at the beginning of the pairs
705705
* struct, otherwise the below qsort would not work.
706706
*/
707-
BUILD_BUG_ON(set8->pairs != &set8->pairs[0].id);
707+
BUILD_BUG_ON((u32 *)set8->pairs != &set8->pairs[0].id);
708708
qsort(set8->pairs, set8->cnt, sizeof(set8->pairs[0]), cmp_id);
709709

710710
/*

0 commit comments

Comments
 (0)