[Intel-gfx] [PATCH i-g-t] tests/gem_pwrite_snooped: disable const cast warning

Thomas Wood thomas.wood at intel.com
Tue Sep 8 03:25:52 PDT 2015


Disable -Wcast-qual temporarily to allow memchr_inv to return non-const
data (similar to memchr), without causing a compiler warning.

Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood at intel.com>
---
 tests/gem_pwrite_snooped.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/gem_pwrite_snooped.c b/tests/gem_pwrite_snooped.c
index d3f6223..3bc4bad 100644
--- a/tests/gem_pwrite_snooped.c
+++ b/tests/gem_pwrite_snooped.c
@@ -83,7 +83,10 @@ static void *memchr_inv(const void *s, int c, size_t n)
 
 	while (n--) {
 		if (*us != uc)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wcast-qual"
 			return (void *) us;
+#pragma GCC diagnostic pop
 		us++;
 	}
 
-- 
1.9.1



More information about the Intel-gfx mailing list