* [PATCH] [v2] gcov: shut up missing prototype warnings for internal stubs
@ 2023-07-25 12:23 Arnd Bergmann
2023-07-28 8:45 ` Peter Oberparleiter
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2023-07-25 12:23 UTC (permalink / raw)
To: Peter Oberparleiter; +Cc: Arnd Bergmann, linux-kernel
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(+)
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
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] [v2] gcov: shut up missing prototype warnings for internal stubs
2023-07-25 12:23 [PATCH] [v2] gcov: shut up missing prototype warnings for internal stubs Arnd Bergmann
@ 2023-07-28 8:45 ` Peter Oberparleiter
0 siblings, 0 replies; 2+ messages in thread
From: Peter Oberparleiter @ 2023-07-28 8:45 UTC (permalink / raw)
To: Arnd Bergmann, Andrew Morton; +Cc: Arnd Bergmann, linux-kernel
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
--
Peter Oberparleiter
Linux on IBM Z Development - IBM Germany R&D
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-28 8:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-25 12:23 [PATCH] [v2] gcov: shut up missing prototype warnings for internal stubs Arnd Bergmann
2023-07-28 8:45 ` Peter Oberparleiter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®