[Piglit] [PATCH] gl-3.0-vertexattribipointer: Fix GCC maybe-uninitialized warning.
Brian Paul
brianp at vmware.com
Thu Jan 8 13:44:01 PST 2015
For all three, Reviewed-by: Brian Paul <brianp at vmware.com>
On 01/08/2015 01:35 PM, Vinson Lee wrote:
> 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 */
>
More information about the Piglit
mailing list