From c50fc1cbfd71dcb1d70fd593b2af7c92af465921 Mon Sep 17 00:00:00 2001 From: Jason Xing Date: Wed, 2 Oct 2024 07:32:42 +0800 Subject: bpf: syscall_nrs: Disable no previous prototype warnning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Andrii Nakryiko 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 --- samples/bpf/syscall_nrs.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'samples') diff --git a/samples/bpf/syscall_nrs.c b/samples/bpf/syscall_nrs.c index 88f940052450..a6e600f3d477 100644 --- a/samples/bpf/syscall_nrs.c +++ b/samples/bpf/syscall_nrs.c @@ -2,6 +2,9 @@ #include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-prototypes" + #define SYSNR(_NR) DEFINE(SYS ## _NR, _NR) void syscall_defines(void) @@ -17,3 +20,5 @@ void syscall_defines(void) #endif } + +#pragma GCC diagnostic pop -- cgit v1.2.3