summaryrefslogtreecommitdiff
path: root/src/compiler-support.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler-support.h')
-rw-r--r--src/compiler-support.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler-support.h b/src/compiler-support.h
index 9e298b278..bf2885993 100644
--- a/src/compiler-support.h
+++ b/src/compiler-support.h
@@ -36,4 +36,10 @@
# define WASM_UNREACHABLE() abort()
#endif
+// The code might contain TODOs or stubs that read some values but do nothing
+// with them. The compiler might fail with [-Werror,-Wunused-variable].
+// The WASM_UNUSED(varible) is a wrapper that helps to suppress the error.
+#define WASM_UNUSED(expr) \
+ do { if (sizeof expr) { (void)0; } } while (0)
+
#endif // wasm_compiler_support_h