summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sanity.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sanity.h b/src/sanity.h
index f2cf0a4..29b3519 100644
--- a/src/sanity.h
+++ b/src/sanity.h
@@ -73,11 +73,16 @@
#define sanitize_uninit(...) SANITIZE_CALL(__msan_allocated_memory, __VA_ARGS__)
#else
-# define sanitize_init(...) ((void)0)
-# define sanitize_uninit(...) ((void)0)
+# define sanitize_init(...) SANITIZE_CALL(sanitize_ignore, __VA_ARGS__)
+# define sanitize_uninit(...) SANITIZE_CALL(sanitize_ignore, __VA_ARGS__)
#endif
/**
+ * Squelch unused variable warnings when not sanitizing.
+ */
+#define sanitize_ignore(ptr, size) ((void)(ptr), (void)(size))
+
+/**
* Initialize a variable, unless sanitizers would detect uninitialized uses.
*/
#if SANITIZE_MEMORY