lkml.org 
[lkml]   [2021]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Makefile: use -Wno-main in the full kernel tree
On Fri, 13 Aug 2021 15:41:31 -0700
Randy Dunlap <rdunlap@infradead.org> wrote:

> When using gcc (SUSE Linux) 7.5.0 (on openSUSE 15.3), I see a
> build warning:
>
> ../kernel/trace/trace_osnoise.c: In function 'start_kthread':
> ../kernel/trace/trace_osnoise.c:1461:8: warning: 'main' is usually a function [-Wmain]
> void *main = osnoise_main;
> ^~~~
>
> Quieten that warning by using "-Wno-main". It's OK to use "main" as a
> declaration name in the kernel.
>
> Build-tested on most ARCHes.
>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Suggested-by: Steven Rostedt <rostedt@goodmis.org>
> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Michal Marek <michal.lkml@markovi.net>
> Cc: linux-kbuild@vger.kernel.org
> ---
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- linux-next-20210812.orig/Makefile
> +++ linux-next-20210812/Makefile
> @@ -522,7 +522,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-P
> KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
> -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
> -Werror=implicit-function-declaration -Werror=implicit-int \
> - -Werror=return-type -Wno-format-security \
> + -Werror=return-type -Wno-format-security -Wno-main \

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

> -std=gnu89
> KBUILD_CPPFLAGS := -D__KERNEL__
> KBUILD_RUST_TARGET := $(srctree)/arch/$(SRCARCH)/rust/target.json

\
 
 \ /
  Last update: 2021-08-16 17:10    [W:0.079 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site