mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-06 23:02:10 +03:00
__assert_fail(): remove _Noreturn, to get proper stacktraces
for _Noreturn functions, gcc generates code that trashes the stack frame, and so it makes it impossible to inspect the causes of an assert error in gdb. abort() is not affected (i have not yet investigated why).
This commit is contained in:
parent
5d893e50b0
commit
2c1f8fd5da
@ -12,7 +12,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
_Noreturn void __assert_fail (const char *, const char *, int, const char *);
|
||||
void __assert_fail (const char *, const char *, int, const char *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
_Noreturn void __assert_fail(const char *expr, const char *file, int line, const char *func)
|
||||
void __assert_fail(const char *expr, const char *file, int line, const char *func)
|
||||
{
|
||||
fprintf(stderr, "Assertion failed: %s (%s: %s: %d)\n", expr, file, func, line);
|
||||
fflush(NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user