diff options
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-04-04 15:28:15 +0200
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-04-17 20:25:55 +0200
commite8e3fc028d6ca4938dec15f5f8e653557fb9e039 (patch)
parent11b39199bec22d2b07ead87599d9eed975947181 (diff)
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.
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 <m0_param.h>
#include "rk3399_mcu.h"
-__attribute__((noreturn)) void main(void)
+__attribute__((noreturn)) void m0_main(void)
switch (mmio_read_32(PARAM_ADDR + PARAM_M0_FUNC)) {
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();