Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bpf: Fix build warning regarding missing prototypes

Fix build warnings when building net/bpf/test_run.o with W=1 due
to missing prototype for bpf_fentry_test{1..6}.

Instead of declaring prototypes, turn off warnings with
__diag_{push,ignore,pop} as pointed out by Alexei.

Signed-off-by: Jean-Philippe Menil <jpmenil@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200327204713.28050-1-jpmenil@gmail.com

authored by

Jean-Philippe Menil and committed by
Daniel Borkmann
e9ff9d52 291cfe36

+4
+4
net/bpf/test_run.c
··· 114 114 * architecture dependent calling conventions. 7+ can be supported in the 115 115 * future. 116 116 */ 117 + __diag_push(); 118 + __diag_ignore(GCC, 8, "-Wmissing-prototypes", 119 + "Global functions as their definitions will be in vmlinux BTF"); 117 120 int noinline bpf_fentry_test1(int a) 118 121 { 119 122 return a + 1; ··· 152 149 *b += 1; 153 150 return a + *b; 154 151 } 152 + __diag_pop(); 155 153 156 154 ALLOW_ERROR_INJECTION(bpf_modify_return_test, ERRNO); 157 155