From 477911553e0443fcafad5bd96c97314aa2f8d9ea Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 14 Jul 2016 10:47:53 +0200 Subject: Integration of scan-build and splint --- src/common/include/debug.h | 8 ++++++-- src/common/libalgo/btree.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/common') diff --git a/src/common/include/debug.h b/src/common/include/debug.h index a4b8b6f..285343c 100644 --- a/src/common/include/debug.h +++ b/src/common/include/debug.h @@ -3,8 +3,12 @@ #include #include -void panic(const char* message, const char* file, int line); -void panic_assert(const char* assertion, const char* file, int line); +void panic(const char* message, const char* file, int line) +__attribute__((__noreturn__)); + +void panic_assert(const char* assertion, const char* file, int line) +__attribute__((__noreturn__)); + #define PANIC(s) panic(s, __FILE__, __LINE__); #define ASSERT(s) { if (!(s)) panic_assert(#s, __FILE__, __LINE__); } diff --git a/src/common/libalgo/btree.c b/src/common/libalgo/btree.c index 45fde1e..d5b34bb 100644 --- a/src/common/libalgo/btree.c +++ b/src/common/libalgo/btree.c @@ -24,7 +24,7 @@ btree_t* create_btree(key_cmp_fun_t cf, kv_iter_fun_t relf) { if (t == 0) return 0; t->cf = cf; - if (t->releasef) t->releasef = relf; + t->releasef = relf; t->root = 0; t->nitems = 0; -- cgit v1.2.3