Mesa (master): mesa: Add uninitialized_vars macro from the Linux kernel.

Matt Turner mattst88 at kemper.freedesktop.org
Thu May 22 17:30:15 UTC 2014


Module: Mesa
Branch: master
Commit: 1a31657a9b14c77fa6eb4517629006d2e9ac2ad4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1a31657a9b14c77fa6eb4517629006d2e9ac2ad4

Author: Matt Turner <mattst88 at gmail.com>
Date:   Fri May  2 12:10:16 2014 -0700

mesa: Add uninitialized_vars macro from the Linux kernel.

---

 src/mesa/main/compiler.h |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h
index 97075f5..6006917 100644
--- a/src/mesa/main/compiler.h
+++ b/src/mesa/main/compiler.h
@@ -264,6 +264,12 @@ static INLINE GLuint CPU_TO_LE32(GLuint x)
 #define unreachable()
 #endif
 
+/*
+ * A trick to suppress uninitialized variable warning without generating any
+ * code
+ */
+#define uninitialized_var(x) x = x
+
 #if (__GNUC__ >= 3)
 #define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a)))
 #else




More information about the mesa-commit mailing list