From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-24.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 846A4C433F5 for ; Thu, 16 Sep 2021 17:11:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70EA060EE9 for ; Thu, 16 Sep 2021 17:11:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344953AbhIPRMW (ORCPT ); Thu, 16 Sep 2021 13:12:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:34038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349196AbhIPRDu (ORCPT ); Thu, 16 Sep 2021 13:03:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6251A61B1B; Thu, 16 Sep 2021 16:34:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631810077; bh=mKUHKt96+zZEBkGgTe+1FJCUtvCvG32ZcnkUl3Tmk68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=laPNrGTpzEekSksiLdMPSbaeFsBypCZ9N7gj+siqhqrybxhVSYBZ/oE7+Nk8xMGS2 YT6Gr8Al0alUZJ8lQMBk6z+YvahzoiJ+lC7oQO0Ijyh5mdOKwVsi9pe+YE91NC/J7y JUeaxehGYdJF1Ac7SmGDozhYAoMf6NhXqkvWGHoc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , Steven Rostedt , Linus Torvalds , Daniel Bristot de Oliveira , Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org Subject: [PATCH 5.14 001/432] Makefile: use -Wno-main in the full kernel tree Date: Thu, 16 Sep 2021 17:55:50 +0200 Message-Id: <20210916155810.865922530@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Randy Dunlap 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 Link: https://lore.kernel.org/lkml/20210813224131.25803-1-rdunlap@infradead.org/ Suggested-by: Steven Rostedt Suggested-by: Linus Torvalds Cc: Daniel Bristot de Oliveira Cc: Masahiro Yamada Cc: Michal Marek Cc: linux-kbuild@vger.kernel.org Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- 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.