Message ID | 20230725123042.2269077-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2442296vqg; Tue, 25 Jul 2023 05:46:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlGaSW078JJtHtFIcZDrzlql+QABh+QERfF2he1UUZwVmNkMycvx2TnI8u0NOkPOwtn/8zeo X-Received: by 2002:a05:6a20:1594:b0:126:a5e3:3927 with SMTP id h20-20020a056a20159400b00126a5e33927mr12277978pzj.8.1690289216418; Tue, 25 Jul 2023 05:46:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690289216; cv=none; d=google.com; s=arc-20160816; b=VqrHlhmZudN/aLeXIZ8Sljc7tjNv7JclHS61/gpk/LF2mxAxzXDe3n6iIDNfQlvr2c C+Hd/vuEqamjCdOgF5EMFN9Ri1gdo6/lwKvWcxMjWWXNVtpy1TTId8SMnQGJzRMb4SKh 75B2l+d5dUaTTVSyB21TpMZNYpl6VEVf7WckX7LOo/TwRAhFdTCck/pWHAISFuKvIjoJ m1Q6PPvdftxMOulPjAYAl9rmg+PtnX1q+XKZ/NK3wyytZfE+OhUMb37DuIOdiUFx4R0e hnY1MpIPMrJ9D03xPatocFv1zsekUPwJqezPAYwMToK9SyqOFkbjkLVPN+BK2Uw33hp0 DlqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=x3mz65iTLGx9rGVA1JdV+y/0QSVapm71NuxT8gIHtCg=; fh=q644RjQqIqwCsO+pwyTGJvEpBZUrCxDvOCUKdYD2JQs=; b=UCw6xZS2cXamojhGyf+wZOl0KT7YPMgoVVNJLm3j2tJ1qp0QiBiAYNxi6UEU6WmIUC IQ9fcnNwZaUIPFpF33cw1yrNovi46EnAZsfPd0LTiQp0fx8Qc+jAK4RF4rEEPCc9jfSL 9kMNnWP4/je/PhufGm+L9/6977VmEFHdpklop26vpBVr3HYEbYdW+ScfrQJd4ghZbRtW kzAEhjEBd6PJyKfvC3/EUs+wPr06E35Xu/uKbXsJq7Rh9klBncOSBnpd4Q8Wrw8vccMf O5AjITFhOiDvDopMTuXkkDs7PB5aJ1PUK7QYUdz5eYl09+ACy6zJ13BktFpK5PI+PPcI +tUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="tpe/KYFZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f8-20020a056a001ac800b006825b4fae9dsi10902380pfv.166.2023.07.25.05.46.42; Tue, 25 Jul 2023 05:46:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="tpe/KYFZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232421AbjGYMau (ORCPT <rfc822;kloczko.tomasz@gmail.com> + 99 others); Tue, 25 Jul 2023 08:30:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232220AbjGYMat (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 25 Jul 2023 08:30:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A725C11A for <linux-kernel@vger.kernel.org>; Tue, 25 Jul 2023 05:30:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3ACC5616B4 for <linux-kernel@vger.kernel.org>; Tue, 25 Jul 2023 12:30:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9D55C433C8; Tue, 25 Jul 2023 12:30:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690288247; bh=5eBs8PdJXRg5fyRZxKrJK1Hfaval0vFUdgh3dE+YiuY=; h=From:To:Cc:Subject:Date:From; b=tpe/KYFZ+zH6LHNBZoeC+oAkadPO+pXt5kv98U6ekk6q+utMGxiuP6kDnn4/lDh51 ks3WLs9k3Dgx0zwD86KyU97rDeDpyMMdzSlh1s5lG9flSfYrdSgh+hUPzBuDhw/RZg f7zJggwfWpp41Gat3DFw9GA0yYrwU/mq5yjWaheTD12hoVMcEXsGCSsaPXXaBLGJJY hTGvZjuba/Gu8vF4qBCnwOSkt9bw4EAoYjob3RoJllYI16La/Jd0Dcw4X8EKFQGlg7 UtM6XCsEKxZYee5uvSwqYQwxKh7MYP7JOxs7D7YYhxM/gJ/JpmUo6A/ueZda61B4ae L5JpCS6Ihjn+g== From: Arnd Bergmann <arnd@kernel.org> To: Peter Oberparleiter <oberpar@linux.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org Subject: [PATCH] [v2] gcov: shut up missing prototype warnings for internal stubs Date: Tue, 25 Jul 2023 14:23:38 +0200 Message-Id: <20230725123042.2269077-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772396705208646053 X-GMAIL-MSGID: 1772396705208646053 |
Series |
[v2] gcov: shut up missing prototype warnings for internal stubs
|
|
Commit Message
Arnd Bergmann
July 25, 2023, 12:23 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> gcov uses global functions that are called from generated code, but these have no prototype in a header, which causes a W=1 build warning: kernel/gcov/gcc_base.c:12:6: error: no previous prototype for '__gcov_init' [-Werror=missing-prototypes] kernel/gcov/gcc_base.c:40:6: error: no previous prototype for '__gcov_flush' [-Werror=missing-prototypes] kernel/gcov/gcc_base.c:46:6: error: no previous prototype for '__gcov_merge_add' [-Werror=missing-prototypes] kernel/gcov/gcc_base.c:52:6: error: no previous prototype for '__gcov_merge_single' [-Werror=missing-prototypes] Just turn off these warnings unconditionally for the two files that contain them. Link: https://lore.kernel.org/all/0820010f-e9dc-779d-7924-49c7df446bce@linux.ibm.com/ Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- kernel/gcov/Makefile | 2 ++ 1 file changed, 2 insertions(+)
Comments
On 25.07.2023 14:23, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > gcov uses global functions that are called from generated code, > but these have no prototype in a header, which causes a W=1 > build warning: > > kernel/gcov/gcc_base.c:12:6: error: no previous prototype for '__gcov_init' [-Werror=missing-prototypes] > kernel/gcov/gcc_base.c:40:6: error: no previous prototype for '__gcov_flush' [-Werror=missing-prototypes] > kernel/gcov/gcc_base.c:46:6: error: no previous prototype for '__gcov_merge_add' [-Werror=missing-prototypes] > kernel/gcov/gcc_base.c:52:6: error: no previous prototype for '__gcov_merge_single' [-Werror=missing-prototypes] > > Just turn off these warnings unconditionally for the two files > that contain them. > > Link: https://lore.kernel.org/all/0820010f-e9dc-779d-7924-49c7df446bce@linux.ibm.com/ > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Tested successfully with GCC 13.1 and Clang 18. Thanks for the fix! Acked-by: Peter Oberparleiter <oberpar@linux.ibm.com> Andrew, could you add this patch via your tree? > --- > kernel/gcov/Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/kernel/gcov/Makefile b/kernel/gcov/Makefile > index 16f8ecc7d8821..ccd02afaeffb4 100644 > --- a/kernel/gcov/Makefile > +++ b/kernel/gcov/Makefile > @@ -3,4 +3,6 @@ ccflags-y := -DSRCTREE='"$(srctree)"' -DOBJTREE='"$(objtree)"' > > obj-y := base.o fs.o > obj-$(CONFIG_CC_IS_GCC) += gcc_base.o gcc_4_7.o > +CFLAGS_gcc_base.o += -Wno-missing-prototypes -Wno-missing-declarations > obj-$(CONFIG_CC_IS_CLANG) += clang.o > +CFLAGS_clang.o += -Wno-missing-prototypes -Wno-missing-declarations
diff --git a/kernel/gcov/Makefile b/kernel/gcov/Makefile index 16f8ecc7d8821..ccd02afaeffb4 100644 --- a/kernel/gcov/Makefile +++ b/kernel/gcov/Makefile @@ -3,4 +3,6 @@ ccflags-y := -DSRCTREE='"$(srctree)"' -DOBJTREE='"$(objtree)"' obj-y := base.o fs.o obj-$(CONFIG_CC_IS_GCC) += gcc_base.o gcc_4_7.o +CFLAGS_gcc_base.o += -Wno-missing-prototypes -Wno-missing-declarations obj-$(CONFIG_CC_IS_CLANG) += clang.o +CFLAGS_clang.o += -Wno-missing-prototypes -Wno-missing-declarations