this reverts commit 2c1f8fd5da. without
the _Noreturn attribute, the compiler cannot use asserts to perform
reachability/range analysis. this leads to missed optimizations and
spurious warnings.
the original backtrace problem that prompted the removal of _Noreturn
was not clearly documented at the time, but it seems to happen only
when libc was built without -g, which also breaks many other
backtracing cases.
10 lines
243 B
C
10 lines
243 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
_Noreturn 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);
|
|
abort();
|
|
}
|