From b79b2fff25be93e262d2e55d02071e577ba41803 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 9 Dec 2013 23:06:40 +0100 Subject: [PATCH] cppcheck: add special BUG_ON so cppcheck understands we exit --- src/suricata-common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/suricata-common.h b/src/suricata-common.h index 0d7b691ddd..4bee62b026 100644 --- a/src/suricata-common.h +++ b/src/suricata-common.h @@ -202,12 +202,16 @@ #endif #endif /* !__CYGWIN__ */ +#if CPPCHECK==1 +#define BUG_ON(x) if (((x))) exit(1) +#else #ifdef HAVE_ASSERT_H #include #define BUG_ON(x) assert(!(x)) #else #define BUG_ON(x) #endif +#endif /* we need this to stringify the defines which are supplied at compiletime see: http://gcc.gnu.org/onlinedocs/gcc-3.4.1/cpp/Stringification.html#Stringification */