]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
cppcheck: add special BUG_ON so cppcheck understands we exit
authorVictor Julien <victor@inliniac.net>
Mon, 9 Dec 2013 22:06:40 +0000 (23:06 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 9 Dec 2013 22:06:40 +0000 (23:06 +0100)
src/suricata-common.h

index 0d7b691ddd7cae3d00a27efa5d9a3cf90200e204..4bee62b026316fa6b3443d5a80062e4d232d65b3 100644 (file)
 #endif
 #endif /* !__CYGWIN__ */
 
+#if CPPCHECK==1
+#define BUG_ON(x) if (((x))) exit(1)
+#else
 #ifdef HAVE_ASSERT_H
 #include <assert.h>
 #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 */