Commit 5c8db485 authored by mux's avatar mux
Browse files

Fix asser_func warning/error

* Add while(1) to assert_func to avoid func returns warning
* Define a weak attr in mpconfig.h
parent 4c4b9d15
......@@ -381,3 +381,8 @@ typedef double mp_float_t;
#ifndef NORETURN
#define NORETURN __attribute__((noreturn))
#endif
// Modifier for weak functions
#ifndef MP_WEAK
#define MP_WEAK __attribute__((weak))
#endif
......@@ -111,11 +111,11 @@ void nlr_jump_fail(void *val) {
}
#ifndef NDEBUG
void __attribute__((weak))
__assert_func(const char *file, int line, const char *func, const char *expr) {
void MP_WEAK __assert_func(const char *file, int line, const char *func, const char *expr) {
(void)func;
printf("Assertion '%s' failed, at file %s:%d\n", expr, file, line);
__fatal_error("");
while (1);
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment