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

bpf: syscall_nrs: Disable no previous prototype warnning

In some environments (gcc treated as error in W=1, which is default), if we
make -C samples/bpf/, it will be stopped because of
"no previous prototype" error like this:

../samples/bpf/syscall_nrs.c:7:6:
error: no previous prototype for ‘syscall_defines’ [-Werror=missing-prototypes]
void syscall_defines(void)
^~~~~~~~~~~~~~~

Actually, this file meets our expectatations because it will be converted to
a .h file. In this way, it's correct. Considering the warnning stopping us
compiling, we can remove the warnning directly.

Signed-off-by: Jason Xing <kernelxing@tencent.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/all/20241001012540.39007-1-kerneljasonxing@gmail.com/
Link: https://lore.kernel.org/all/CAEf4BzaVdr_0kQo=+jPLN++PvcU6pwTjaPVEA880kgDN94TZYw@mail.gmail.com/
Link: https://lore.kernel.org/bpf/20241001233242.98679-1-kerneljasonxing@gmail.com

authored by

Jason Xing and committed by
Andrii Nakryiko
c50fc1cb 4236f114

+5
+5
samples/bpf/syscall_nrs.c
··· 2 2 #include <uapi/linux/unistd.h> 3 3 #include <linux/kbuild.h> 4 4 5 + #pragma GCC diagnostic push 6 + #pragma GCC diagnostic ignored "-Wmissing-prototypes" 7 + 5 8 #define SYSNR(_NR) DEFINE(SYS ## _NR, _NR) 6 9 7 10 void syscall_defines(void) ··· 20 17 #endif 21 18 22 19 } 20 + 21 + #pragma GCC diagnostic pop