[lkml]   [2021]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [PATCH] Makefile: use -Wno-main in the full kernel tree
On Fri, Aug 13, 2021 at 2:01 PM Linus Torvalds
<> wrote:
> From a quick google, it seems like '-Wmain' means something else for
> clang. But it is probably ok.

So the warnings that clang gives with -Wmain seem to be much more reasonable.

Which makes me think that the '-Wno-main' thing would likely be better
as a gcc-only thing.

Maybe something like this instead?

Makefile | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Makefile b/Makefile
index c19d1638da25..a33fba083df7 100644
--- a/Makefile
+++ b/Makefile
@@ -803,6 +803,8 @@ else
# Disabled for clang while comment to attribute conversion happens and
# is discussed.
KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough=5,)
+# gcc inanely warns about local variables called 'main'
+KBUILD_CFLAGS += -Wno-main

# These warnings generated too much noise in a regular build.
 \ /
  Last update: 2021-08-17 02:35    [W:0.054 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site