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 <keithp@keithp.com>
diff --git a/kernel/main_weak.c b/kernel/main_weak.c
index 89a4ab0..0c25f76 100644
--- a/kernel/main_weak.c
+++ b/kernel/main_weak.c
@@ -21,16 +21,10 @@
#include <kernel_internal.h>
-#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
}