* [PATCH 5.14 001/432] Makefile: use -Wno-main in the full kernel tree
[not found] <20210916155810.813340753@linuxfoundation.org>
@ 2021-09-16 15:55 ` Greg Kroah-Hartman
0 siblings, 0 replies; only message in thread
From: Greg Kroah-Hartman @ 2021-09-16 15:55 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Randy Dunlap, Steven Rostedt,
Linus Torvalds, Daniel Bristot de Oliveira, Masahiro Yamada,
Michal Marek, linux-kbuild
From: Randy Dunlap <rdunlap@infradead.org>
commit 49832c819ab85b33b7a2a1429c8d067e82be2977 upstream.
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.
[ v2: only do it for gcc, since clang doesn't have that particular warning ]
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/lkml/20210813224131.25803-1-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
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Makefile | 2 ++
1 file changed, 2 insertions(+)
--- a/Makefile
+++ b/Makefile
@@ -803,6 +803,8 @@ else
# Disabled for clang while comment to attribute conversion happens and
# https://github.com/ClangBuiltLinux/linux/issues/636 is discussed.
KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough=5,)
+# gcc inanely warns about local variables called 'main'
+KBUILD_CFLAGS += -Wno-main
endif
# These warnings generated too much noise in a regular build.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-09-16 17:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20210916155810.813340753@linuxfoundation.org>
2021-09-16 15:55 ` [PATCH 5.14 001/432] Makefile: use -Wno-main in the full kernel tree Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox