From 631f66bd0839e848a3560206994872ae885c1ceb Mon Sep 17 00:00:00 2001 From: Takayuki 'January June' Suwa Date: Fri, 27 Mar 2020 06:28:09 +0900 Subject: [PATCH] Attribute `__real_system_restart_local()` as `(noreturn)` (#7167) * Attribute `__real_system_restart_local()` as `(noreturn)` * As well as `abort()`. * Aggragate two decls into `coredecls.h`. --- cores/esp8266/Esp.cpp | 3 --- cores/esp8266/core_esp8266_postmortem.cpp | 3 +-- cores/esp8266/coredecls.h | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cores/esp8266/Esp.cpp b/cores/esp8266/Esp.cpp index a0e525f2b..21ffe880e 100644 --- a/cores/esp8266/Esp.cpp +++ b/cores/esp8266/Esp.cpp @@ -193,9 +193,6 @@ bool EspClass::rtcUserMemoryWrite(uint32_t offset, uint32_t *data, size_t size) } } - - -extern "C" void __real_system_restart_local(); void EspClass::reset(void) { __real_system_restart_local(); diff --git a/cores/esp8266/core_esp8266_postmortem.cpp b/cores/esp8266/core_esp8266_postmortem.cpp index 84aad50a0..2af579883 100644 --- a/cores/esp8266/core_esp8266_postmortem.cpp +++ b/cores/esp8266/core_esp8266_postmortem.cpp @@ -32,11 +32,10 @@ #include "pgmspace.h" #include "gdb_hooks.h" #include "StackThunk.h" +#include "coredecls.h" extern "C" { -extern void __real_system_restart_local(); - // These will be pointers to PROGMEM const strings static const char* s_panic_file = 0; static int s_panic_line = 0; diff --git a/cores/esp8266/coredecls.h b/cores/esp8266/coredecls.h index 86ba43711..aa37cb06b 100644 --- a/cores/esp8266/coredecls.h +++ b/cores/esp8266/coredecls.h @@ -21,6 +21,7 @@ void esp_schedule(); void tune_timeshift64 (uint64_t now_us); void disable_extra4k_at_link_time (void) __attribute__((noinline)); bool sntp_set_timezone_in_seconds(int32_t timezone); +void __real_system_restart_local() __attribute__((noreturn)); uint32_t sqrt32 (uint32_t n); uint32_t crc32 (const void* data, size_t length, uint32_t crc = 0xffffffff);