aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKaterina Barone-Adesi <kat.obsc@gmail.com>2013-03-12 10:23:52 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-03-25 12:06:15 +0100
commit55cf02221f0654a3f48888f3b13766b671a120f0 (patch)
tree953511f667b7d4a8364ce3186de8b1ff3c48cb6d /include
parent1a02cfc24d2c812ba13e5aa936588be447bb24af (diff)
utils: Use fprintf to print the assertion and generate a backtrace
This is changing the semantic of the assert. The regression tests now either need to check the stderr result, the exit status or print a message when all tests are completed. This is not that bad as the osmo_generate_backtrace is printing to the stdout right now.
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/core/utils.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index 8f7bee31..f8e6fc96 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -53,7 +53,8 @@ do { \
#define OSMO_ASSERT(exp) \
if (!(exp)) { \
- printf("Assert failed %s %s:%d\n", #exp, __FILE__, __LINE__); \
+ fprintf(stderr, "Assert failed %s %s:%d\n", #exp, __FILE__, __LINE__); \
+ osmo_generate_backtrace(); \
abort(); \
}