Mesa (master): mesa: Avoid MSVC C6334 warning in /analyze mode.
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Wed Mar 25 10:44:19 UTC 2015
Module: Mesa
Branch: master
Commit: cb88edbd4e9cb198013129a360cb3d4163ac3837
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb88edbd4e9cb198013129a360cb3d4163ac3837
Author: Jose Fonseca <jfonseca at vmware.com>
Date: Tue Mar 24 19:01:46 2015 +0000
mesa: Avoid MSVC C6334 warning in /analyze mode.
MSVC's implementation of signbit(x) uses sizeof(x) with expressions to
dispatch to an internal function based on the argument's type (float,
double, etc), but that raises a flag with MSVC's own static analyzer,
and because this is an inline function in a header it causes substantial
warning spam.
Reviewed-by: Brian Paul <brianp at vmware.com>
---
src/mesa/main/macros.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index 2d7a6a1..3344ec8 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -789,7 +789,14 @@ NORMALIZE_3FV(GLfloat v[3])
static inline GLboolean
DIFFERENT_SIGNS(GLfloat x, GLfloat y)
{
+#ifdef _MSC_VER
+#pragma warning( push )
+#pragma warning( disable : 6334 ) /* sizeof operator applied to an expression with an operator may yield unexpected results */
+#endif
return signbit(x) != signbit(y);
+#ifdef _MSC_VER
+#pragma warning( pop )
+#endif
}
More information about the mesa-commit
mailing list