[Piglit] [PATCH] gl-2.0-vertexattribpointer: Fix GCC maybe-uninitialized warning.

Vinson Lee vlee at freedesktop.org
Tue Jan 6 16:50:58 PST 2015


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

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

diff --git a/tests/spec/gl-2.0/vertexattribpointer.c b/tests/spec/gl-2.0/vertexattribpointer.c
index 872447b..46fabcc 100644
--- a/tests/spec/gl-2.0/vertexattribpointer.c
+++ b/tests/spec/gl-2.0/vertexattribpointer.c
@@ -153,6 +153,7 @@ test_array(GLenum type, GLuint size, GLboolean normalized)
 		assert(0);
 		maxVal = 1.0;
 		typeSize = sizeof(GLfloat);
+		data = NULL;
 	}
 
 	if (normalized) {
-- 
2.2.0



More information about the Piglit mailing list