[Piglit] [PATCH] gl-3.0-vertexattribipointer: Fix GCC maybe-uninitialized warning.

Vinson Lee vlee at freedesktop.org
Thu Jan 8 12:35:59 PST 2015


vertexattribipointer.c: In function 'piglit_display':
vertexattribipointer.c:156:4: warning: 'data' may be used uninitialized in this function [-Wmaybe-uninitialized]
    memcpy(attr_buffer + i * sz, data, sz);
    ^
vertexattribipointer.c:94:14: note: 'data' was declared here
  const void *data;
              ^

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

diff --git a/tests/spec/gl-3.0/vertexattribipointer.c b/tests/spec/gl-3.0/vertexattribipointer.c
index b01fe51..8ac00f7 100644
--- a/tests/spec/gl-3.0/vertexattribipointer.c
+++ b/tests/spec/gl-3.0/vertexattribipointer.c
@@ -135,6 +135,7 @@ test_array(GLenum type, GLuint size)
 	default:
 		assert(0);
 		typeSize = sizeof(GLint);
+		data = NULL;
 	}
 
 	/* set unused components to defaults */
-- 
2.2.0



More information about the Piglit mailing list