This patch fixes this GCC format-security warning.
enqueue-read_write-buffer.c: In function ‘piglit_cl_test’:
enqueue-read_write-buffer.c:319:8: warning: format not a string literal and no
format arguments [-Wformat-security]
fprintf(stderr, test_str_read);
^
Signed-off-by: Vinson Lee <[email protected]>
---
tests/cl/api/enqueue-read_write-buffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/cl/api/enqueue-read_write-buffer.c
b/tests/cl/api/enqueue-read_write-buffer.c
index bf88d5e..f98125c 100644
--- a/tests/cl/api/enqueue-read_write-buffer.c
+++ b/tests/cl/api/enqueue-read_write-buffer.c
@@ -316,7 +316,7 @@ piglit_cl_test(const int argc,
sprintf(test_str_read,
"Data read from
buffer is not the same as data written to buffer using 0x%X as memory flags",
(unsigned
int)mixed_mem_flags);
- fprintf(stderr,
test_str_read);
+ fprintf(stderr, "%s",
test_str_read);
printf(" Device: %s\n
mem_flags: 0x%x, offset: %d, bytes: %d \n",
device_name,
--
1.8.3.2
_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit