aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/sys.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-02-17 19:21:06 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-12 19:15:24 +0100
commitaf34cc859ae9979e9f4f8abf29646efd6b1c9c04 (patch)
treeeef6e1530e79e35ec6f9b2f00021cf59d6c7d027 /erts/emulator/beam/sys.h
parent7e3c3c7106095cc5afdbd5cd7e96b907784ada01 (diff)
downloadotp-af34cc859ae9979e9f4f8abf29646efd6b1c9c04.tar.gz
otp-af34cc859ae9979e9f4f8abf29646efd6b1c9c04.tar.bz2
otp-af34cc859ae9979e9f4f8abf29646efd6b1c9c04.zip
erts: Add ERTS_UNDEF macro
Diffstat (limited to 'erts/emulator/beam/sys.h')
-rw-r--r--erts/emulator/beam/sys.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h
index 828f5b427a..d2a8b9e7f4 100644
--- a/erts/emulator/beam/sys.h
+++ b/erts/emulator/beam/sys.h
@@ -188,6 +188,16 @@ __decl_noreturn void __noreturn erl_assert_error(const char* expr, const char *f
# define ASSERT(e) ((void) 1)
#endif
+/* ERTS_UNDEF can be used to silence false warnings about
+ * "variable may be used uninitialized" while keeping the variable
+ * marked as undefined by valgrind.
+ */
+#ifdef VALGRIND
+# define ERTS_UNDEF(V,I)
+#else
+# define ERTS_UNDEF(V,I) V = I
+#endif
+
/*
* Compile time assert
* (the actual compiler error msg can be a bit confusing)