From fc076f5a1deef390f4c988985a0036c2fdda40f5 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 8 Feb 2023 21:20:55 -0800 Subject: [PATCH] kernel: Switch main return type from void to int As both C and C++ standards require applications running under an OS to return 'int', adapt that for Zephyr to align with those standard. This also eliminates errors when building with clang when not using -ffreestanding, and reduces the need for compiler flags to silence warnings for both clang and gcc Signed-off-by: Keith Packard --- kernel/main_weak.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/kernel/main_weak.c b/kernel/main_weak.c index 89a4ab09ff..0c25f764d3 100644 --- a/kernel/main_weak.c +++ b/kernel/main_weak.c @@ -21,16 +21,10 @@ #include -#ifdef CONFIG_CPP_MAIN int __weak main(void) -#else -void __weak main(void) -#endif { /* NOP default main() if the application does not provide one. */ arch_nop(); -#ifdef CONFIG_CPP_MAIN return 0; -#endif }