From: Victor Julien Date: Mon, 9 Dec 2013 22:06:40 +0000 (+0100) Subject: cppcheck: add special BUG_ON so cppcheck understands we exit X-Git-Tag: suricata-2.0beta2~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b79b2fff25be93e262d2e55d02071e577ba41803;p=thirdparty%2Fsuricata.git cppcheck: add special BUG_ON so cppcheck understands we exit --- 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 */