aboutgitcodebugslistschat
path: root/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'util.h')
-rw-r--r--util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/util.h b/util.h
index 2858b10..0bf396a 100644
--- a/util.h
+++ b/util.h
@@ -68,6 +68,15 @@
#define STRINGIFY(x) #x
#define STR(x) STRINGIFY(x)
+#ifdef CPPCHECK_6936
+/* Some cppcheck versions get confused by aborts inside a loop, causing
+ * it to give false positive uninitialised variable warnings later in
+ * the function, because it doesn't realise the non-initialising path
+ * already exited. See https://trac.cppcheck.net/ticket/13227
+ */
+#define ASSERT(expr) \
+ ((expr) ? (void)0 : abort())
+#else
#define ASSERT(expr) \
do { \
if (!(expr)) { \
@@ -79,6 +88,7 @@
abort(); \
} \
} while (0)
+#endif
#ifdef P_tmpdir
#define TMPDIR P_tmpdir