[Piglit] [PATCH] arb_uniform_buffer_object: Silence uninitialized variable warnings.

Vinson Lee vlee at freedesktop.org
Fri Jan 24 22:59:36 PST 2014


This patch fixes these GCC maybe-uninitialized warnings.

maxuniformblocksize.c:143:2: warning: 'target' may be used uninitialized in this function [-Wmaybe-uninitialized]
  switch (target) {
  ^
maxuniformblocksize.c:166:5: warning: 'may_link_fail' may be used uninitialized in this function [-Wmaybe-uninitialized]
  if (may_link_fail) {
     ^

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/spec/arb_uniform_buffer_object/maxuniformblocksize.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/spec/arb_uniform_buffer_object/maxuniformblocksize.c b/tests/spec/arb_uniform_buffer_object/maxuniformblocksize.c
index 26349da..720fc5c 100644
--- a/tests/spec/arb_uniform_buffer_object/maxuniformblocksize.c
+++ b/tests/spec/arb_uniform_buffer_object/maxuniformblocksize.c
@@ -138,6 +138,10 @@ piglit_display(void)
 		may_link_fail = true;
 		vec4s++;
 		break;
+	default:
+		assert(false);
+		target = GL_NONE;
+		may_link_fail = false;
 	}
 
 	switch (target) {
-- 
1.8.5.3



More information about the Piglit mailing list