Skip to content

Commit 72ab55e

Browse files
Jiri Bencborkmann
authored andcommitted
tools: bpftool: silence 'missing initializer' warnings
When building bpf tool, gcc emits piles of warnings: prog.c: In function ‘prog_fd_by_tag’: prog.c:101:9: warning: missing initializer for field ‘type’ of ‘struct bpf_prog_info’ [-Wmissing-field-initializers] struct bpf_prog_info info = {}; ^ In file included from /home/storage/jbenc/git/net-next/tools/lib/bpf/bpf.h:26:0, from prog.c:47: /home/storage/jbenc/git/net-next/tools/include/uapi/linux/bpf.h:925:8: note: ‘type’ declared here __u32 type; ^ As these warnings are not useful, switch them off. Signed-off-by: Jiri Benc <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
1 parent 12ef9bd commit 72ab55e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/bpf/bpftool/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ bash_compdir ?= /usr/share/bash-completion/completions
3838
CC = gcc
3939

4040
CFLAGS += -O2
41-
CFLAGS += -W -Wall -Wextra -Wno-unused-parameter -Wshadow
41+
CFLAGS += -W -Wall -Wextra -Wno-unused-parameter -Wshadow -Wno-missing-field-initializers
4242
CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ -I$(srctree)/tools/include/uapi -I$(srctree)/tools/include -I$(srctree)/tools/lib/bpf -I$(srctree)/kernel/bpf/
4343
CFLAGS += -DBPFTOOL_VERSION='"$(BPFTOOL_VERSION)"'
4444
LIBS = -lelf -lbfd -lopcodes $(LIBBPF)

0 commit comments

Comments
 (0)