From e8e3fc028d6ca4938dec15f5f8e653557fb9e039 Mon Sep 17 00:00:00 2001 From: Philipp Tomsich Date: Tue, 4 Apr 2017 15:28:15 +0200 Subject: src: rename main function to 'm0_main' to avoid warnings With recent GCC versions (we currently use GCC-6.3.0 for code-size and static analysis reasons), we can neither have a main()-function that has a void return-type (warns on return not being 'int') nor can we have a function with an 'int' return-type marked 'noreturn'. Consequently we rename the main-function to 'm0_main' to help the compiler understand that we are not in a standard C runtime. --- src/main.c | 2 +- src/startup.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 95659c4..7ab16e2 100644 --- a/src/main.c +++ b/src/main.c @@ -31,7 +31,7 @@ #include #include "rk3399_mcu.h" -__attribute__((noreturn)) void main(void) +__attribute__((noreturn)) void m0_main(void) { switch (mmio_read_32(PARAM_ADDR + PARAM_M0_FUNC)) { case M0_FUNC_SUSPEND: diff --git a/src/startup.c b/src/startup.c index 47561fd..d8ef57d 100644 --- a/src/startup.c +++ b/src/startup.c @@ -47,7 +47,7 @@ void WEAK svc_handler(void); void WEAK pend_sv_handler(void); void WEAK systick_handler(void); -extern int main(void); +extern void m0_main(void); /* Function prototypes */ static void default_reset_handler(void); @@ -88,7 +88,7 @@ void (* const g_pfnVectors[])(void) = { static void default_reset_handler(void) { /* call the application's entry point */ - main(); + m0_main(); } /** -- cgit v1.2.3