[Piglit] [PATCH] cl-program-tester: Fix GCC format-security warning.

Tom Stellard tom at stellard.net
Thu Jan 30 07:20:58 PST 2014


On Wed, Jan 29, 2014 at 08:17:17PM -0800, Vinson Lee wrote:
> This patch fixes this GCC format-security warning.
> 
> program-tester.c: In function ‘piglit_cl_test’:
> program-tester.c:1978:3: warning: format not a string literal and no format arguments [-Wformat-security]
>    piglit_report_subtest_result(test_result, tests[i].name);
>    ^
> 
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
> ---
>  tests/cl/program/program-tester.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/cl/program/program-tester.c b/tests/cl/program/program-tester.c
> index d93034e..6ff3251 100644
> --- a/tests/cl/program/program-tester.c
> +++ b/tests/cl/program/program-tester.c
> @@ -1975,7 +1975,7 @@ piglit_cl_test(const int argc,
>  		test_result = test_kernel(config, env, tests[i]);
>  		piglit_merge_result(&result, test_result);
>  
> -		piglit_report_subtest_result(test_result, tests[i].name);
> +		piglit_report_subtest_result(test_result, "%s", tests[i].name);
>  	}
>  
>  	/* Print result */
> -- 
> 1.8.3.2
> 
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list