[Piglit] [PATCH 2/3] util: Disable "overflow in floating-point constant arithmetic" in strtod_inf.
Jose Fonseca
jfonseca at vmware.com
Wed Dec 3 07:37:22 PST 2014
From: José Fonseca <jfonseca at vmware.com>
Now that this is an inline function, the warning appears all over the
place.
---
tests/util/piglit-util.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index 90d57d3..099075a 100755
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -187,6 +187,9 @@ strtod_inf(const char *nptr, char **endptr)
while (*nptr == ' ' || *nptr == '\t')
nptr++;
+#pragma warning( push )
+#pragma warning( disable : 4056 ) // overflow in floating-point constant arithmetic
+#pragma warning( disable : 4756 ) // overflow in constant arithmetic
if (nptr[0] == 'i' && nptr[1] == 'n' && nptr[2] == 'f') {
/* +infinity */
*endptr = (char *) (nptr + 3);
@@ -197,6 +200,8 @@ strtod_inf(const char *nptr, char **endptr)
*endptr = (char *) (nptr + 4);
return -INFINITY;
}
+#pragma warning( pop )
+
/* fall-through */
#endif
return strtod(nptr, endptr);
--
2.1.0
More information about the Piglit
mailing list