Skip to content

Commit 58cd4a0

Browse files
fvincenzoctmarinas
authored andcommitted
arm64: vdso: Fix "no previous prototype" warning
If compiling the arm64 kernel with W=1 the following warning is produced: | arch/arm64/kernel/vdso/vgettimeofday.c:9:5: error: no previous prototype for ‘__kernel_clock_gettime’ [-Werror=missing-prototypes] | 9 | int __kernel_clock_gettime(clockid_t clock, | | ^~~~~~~~~~~~~~~~~~~~~~ | arch/arm64/kernel/vdso/vgettimeofday.c:15:5: error: no previous prototype for ‘__kernel_gettimeofday’ [-Werror=missing-prototypes] | 15 | int __kernel_gettimeofday(struct __kernel_old_timeval *tv, | | ^~~~~~~~~~~~~~~~~~~~~ | arch/arm64/kernel/vdso/vgettimeofday.c:21:5: error: no previous prototype for ‘__kernel_clock_getres’ [-Werror=missing-prototypes] | 21 | int __kernel_clock_getres(clockid_t clock_id, | | ^~~~~~~~~~~~~~~~~~~~~ This patch removes "-Wmissing-prototypes" and "-Wmissing-declarations" compilers flags from the compilation of vgettimeofday.c to make possible to build the kernel with CONFIG_WERROR enabled. Cc: Will Deacon <[email protected]> Reported-by: Marc Kleine-Budde <[email protected]> Signed-off-by: Vincenzo Frascino <[email protected]> Tested-by: Marc Kleine-Budde <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent e783362 commit 58cd4a0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/arm64/kernel/vdso/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ ldflags-y := -shared -soname=linux-vdso.so.1 --hash-style=sysv \
2929
ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
3030
ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
3131

32+
# -Wmissing-prototypes and -Wmissing-declarations are removed from
33+
# the CFLAGS of vgettimeofday.c to make possible to build the
34+
# kernel with CONFIG_WERROR enabled.
3235
CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS) $(GCC_PLUGINS_CFLAGS) \
33-
$(CC_FLAGS_LTO)
36+
$(CC_FLAGS_LTO) -Wmissing-prototypes -Wmissing-declarations
3437
KASAN_SANITIZE := n
3538
KCSAN_SANITIZE := n
3639
UBSAN_SANITIZE := n

0 commit comments

Comments
 (0)