diff options
author | rofl0r <retnyg@gmx.net> | 2013-01-01 07:59:11 +0100 |
---|---|---|
committer | rofl0r <retnyg@gmx.net> | 2013-01-04 20:36:34 +0100 |
commit | 2c1f8fd5da3306fd7c8a2267467e44eb61f12dd4 (patch) | |
tree | 9b10c915f1cb4ae8e76e285b5330f4236ac5bf5d | |
parent | 5d893e50b063e67360dabb120b547ba52bfc5b87 (diff) | |
download | musl-2c1f8fd5da3306fd7c8a2267467e44eb61f12dd4.tar.gz musl-2c1f8fd5da3306fd7c8a2267467e44eb61f12dd4.tar.bz2 musl-2c1f8fd5da3306fd7c8a2267467e44eb61f12dd4.tar.xz musl-2c1f8fd5da3306fd7c8a2267467e44eb61f12dd4.zip |
__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).
-rw-r--r-- | include/assert.h | 2 | ||||
-rw-r--r-- | src/exit/assert.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/assert.h b/include/assert.h index c64d3e52..ab745db1 100644 --- a/include/assert.h +++ b/include/assert.h @@ -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 } diff --git a/src/exit/assert.c b/src/exit/assert.c index 49b0dc3e..e87442a7 100644 --- a/src/exit/assert.c +++ b/src/exit/assert.c @@ -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); |