[Piglit] [PATCH] ext_transform_feedback: Silence GCC maybe-uninitialized warning.

Brian Paul brianp at vmware.com
Thu Nov 13 13:59:02 PST 2014


On 11/13/2014 11:39 AM, Vinson Lee wrote:
> Fixes this GCC warning.
>
> api-errors.c:401:21: warning: 'progs[1]' may be used uninitialized in this function [-Wmaybe-uninitialized]
>     glUseProgramStages(pipes[1], GL_VERTEX_SHADER_BIT, progs[1]);
>                       ^
> api-errors.c:214:9: note: 'progs[1]' was declared here
>    GLuint progs[2];
>           ^
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>   tests/spec/ext_transform_feedback/api-errors.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/spec/ext_transform_feedback/api-errors.c b/tests/spec/ext_transform_feedback/api-errors.c
> index 57bb97f..d620888 100644
> --- a/tests/spec/ext_transform_feedback/api-errors.c
> +++ b/tests/spec/ext_transform_feedback/api-errors.c
> @@ -211,7 +211,7 @@ static GLboolean
>   do_test(const struct test_desc *test)
>   {
>   	GLuint vs;
> -	GLuint progs[2];
> +	GLuint progs[2] = { 0 };
>   	GLuint pipes[2];
>   	GLuint bufs[NUM_BUFFERS];
>   	float initial_xfb_buffer_contents[XFB_BUFFER_SIZE];
>

Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the Piglit mailing list