Skip to contentSkip to conversation

silence warnings when building kernel/bpf/core.c with W=1

PATCH Superseded Valdis Kletnieks 2 participants 2 messages Aug 1, 2016

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 silence warnings when building kernel/bpf/core.c with W=1

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.

kernel/bpf/Makefile +1 -0
index eed911d091da..bb915f9d9f92 100644
@@ -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
maintainer
#1 lore raw

From: Valdis Kletnieks <[email protected]>
Date: Sun, 31 Jul 2016 23:27:33 -0400

Quoted 5 lines

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,

Quoted 7 lines
                                 ^~

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.

Patch submission must use a proper subsystem prefix in their Subject lines, as this ends up in the kernel commit shortlog.

The appropriate subsystem prefix for this patch is "bpf: "