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

Anuj Phogat anuj.phogat at gmail.com
Wed Jan 7 11:04:20 PST 2015


On Tue, Jan 6, 2015 at 4:50 PM, Vinson Lee <vlee at freedesktop.org> wrote:
> 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
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit

Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>


More information about the Piglit mailing list