[Piglit] [PATCH] arb_copy_image-formats: Initialize variable.

Vinson Lee vlee at freedesktop.org
Fri Nov 7 15:11:39 PST 2014


Fixes GCC maybe-uninitialized warning.

formats.c:560:11: warning: 'gtype' may be used uninitialized in this function [-Wmaybe-uninitialized]
   snprintf(fs_src, sizeof(ms_compare_fs_source),
           ^

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/spec/arb_copy_image/formats.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/spec/arb_copy_image/formats.c b/tests/spec/arb_copy_image/formats.c
index 92715ba..8a5faa7 100644
--- a/tests/spec/arb_copy_image/formats.c
+++ b/tests/spec/arb_copy_image/formats.c
@@ -551,6 +551,7 @@ load_compare_program(struct texture_format *format)
 			gtype = "i";
 		} else {
 			assert(!"Invalid comparison fucntion");
+			gtype = "";
 		}
 
 		/* The generated source will be shorter because we replace
-- 
1.9.3



More information about the Piglit mailing list