[Piglit] [PATCH] arb_texture_view-formats: Silence uninitialized variable warning.

Jon Ashburn jon at lunarg.com
Mon Jan 27 10:07:33 PST 2014


Looks good.
Reviewed-by: Jon Ashburn <jon at lunarg.com>

On 1/25/14, 12:05 AM, Vinson Lee wrote:
> This patch fixes this GCC maybe-uninitialized warning.
>
> formats.c: In function 'test_format_errors':
> formats.c:269:27: warning: 'numFormats' may be used uninitialized in this function [-Wmaybe-uninitialized]
>    pass = check_format_array(GL_NO_ERROR, numFormats, legalFormats,
>                             ^
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>   tests/spec/arb_texture_view/formats.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/tests/spec/arb_texture_view/formats.c b/tests/spec/arb_texture_view/formats.c
> index d971c3b..78d0869 100644
> --- a/tests/spec/arb_texture_view/formats.c
> +++ b/tests/spec/arb_texture_view/formats.c
> @@ -256,6 +256,7 @@ test_format_errors(GLenum format_class)
>   		break;
>   	default:
>   	    assert(!"Invalid format_class\n");
> +	    numFormats = 0;
>   	}
>   
>   	if (!piglit_check_gl_error(GL_NO_ERROR)) {



More information about the Piglit mailing list