netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] bpf: silence warnings when building kernel/bpf/core.c with W=1
@ 2016-08-01  4:33 Valdis Kletnieks
  2016-08-01  4:42 ` Alexei Starovoitov
  0 siblings, 1 reply; 4+ messages in thread
From: Valdis Kletnieks @ 2016-08-01  4:33 UTC (permalink / raw)
  To: Alexei Starovoitov; +Cc: netdev, linux-kernel

Building with W=1 generates some 350 lines of warnings of the form:

kernel/bpf/core.c: In function '__bpf_prog_run':
kernel/bpf/core.c:476:33: warning: initialized field overwritten [-Woverride-init]
   [BPF_ALU | BPF_ADD | BPF_X] = &&ALU_ADD_X,
                                 ^~
kernel/bpf/core.c:476:33: note: (near initialization for 'jumptable[12]')

Since they come from the way we intentionally build the table, silence
that one specific warning.

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>

Version 2: Add bpf: subsystem tag to subject line

diff --git a/kernel/bpf/Makefile b/kernel/bpf/Makefile
index eed911d091da..bb915f9d9f92 100644
--- a/kernel/bpf/Makefile
+++ b/kernel/bpf/Makefile
@@ -1,3 +1,4 @@
+CFLAGS_core.o += -Wno-override-init
 obj-y := core.o
 
 obj-$(CONFIG_BPF_SYSCALL) += syscall.o verifier.o inode.o helpers.o

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-01 15:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-01  4:33 [PATCH v2] bpf: silence warnings when building kernel/bpf/core.c with W=1 Valdis Kletnieks
2016-08-01  4:42 ` Alexei Starovoitov
2016-08-01  5:18   ` Valdis.Kletnieks
2016-08-01 15:09     ` Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).