1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-30 00:41:17 +01:00

Merge pull request #892 from OlegHahm/crash_noreturn

cpu: satisfy compiler in crash.c for ARM and MSP430
This commit is contained in:
Kévin Roussel 2014-04-09 12:59:01 +02:00
commit f3024916ef
4 changed files with 36 additions and 2 deletions

View File

@ -60,4 +60,14 @@ NORETURN void core_panic(int crash_code, const char *message)
/* DEVELHELP not set => reboot system */
(void) reboot(RB_AUTOBOOT);
#endif
/* tell the compiler that we won't return from this function
(even if we actually won't even get here...) */
#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ >= 5)
__builtin_unreachable();
#else
while (1) {
/* do nothing, but do it often */
}
#endif
}

View File

@ -61,4 +61,14 @@ NORETURN void core_panic(int crash_code, const char *message)
/* DEVELHELP not set => reboot system */
(void) reboot(RB_AUTOBOOT);
#endif
/* tell the compiler that we won't return from this function
(even if we actually won't even get here...) */
#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ >= 5)
__builtin_unreachable();
#else
while (1) {
/* do nothing, but do it often */
}
#endif
}

View File

@ -60,4 +60,14 @@ NORETURN void core_panic(int crash_code, const char *message)
/* DEVELHELP not set => reboot system */
(void) reboot(RB_AUTOBOOT);
#endif
/* tell the compiler that we won't return from this function
(even if we actually won't even get here...) */
#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ >= 5)
__builtin_unreachable();
#else
while (1) {
/* do nothing, but do it often */
}
#endif
}

View File

@ -58,9 +58,13 @@ NORETURN void core_panic(int crash_code, const char *message)
(void) reboot(RB_AUTOBOOT);
#endif
/* proove the compiler that we won't return from this function
/* tell the compiler that we won't return from this function
(even if we actually won't even get here...) */
#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ >= 5)
__builtin_unreachable();
#else
while (1) {
/* nothing in particular */;
/* do nothing, but do it often */
}
#endif
}