[Piglit] [PATCH] util: Fix GCC format-security warnings.

Brian Paul brianp at vmware.com
Sat Dec 21 09:51:13 PST 2013


On 12/20/2013 07:33 PM, Vinson Lee wrote:
> This patches fixes these GCC warnings.
>
> piglit-framework-gl.c: In function ‘piglit_run_selected_subtests’:
> piglit-framework-gl.c:294:12: warning: format not a string literal and no format arguments [-Wformat-security]
>              subtest->name);
>              ^
> piglit-framework-gl.c:305:12: warning: format not a string literal and no format arguments [-Wformat-security]
>              all_subtests[i].name);
>              ^
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>   tests/util/piglit-framework-gl.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/util/piglit-framework-gl.c b/tests/util/piglit-framework-gl.c
> index a0ccbe0..561b1cd 100644
> --- a/tests/util/piglit-framework-gl.c
> +++ b/tests/util/piglit-framework-gl.c
> @@ -290,7 +290,7 @@ piglit_run_selected_subtests(const struct piglit_gl_subtest *all_subtests,
>   			}
>
>   			subtest_result = subtest->subtest_func(subtest->data);
> -			piglit_report_subtest_result(subtest_result,
> +			piglit_report_subtest_result(subtest_result, "%s",
>   						     subtest->name);
>
>   			piglit_merge_result(&result, subtest_result);
> @@ -301,7 +301,7 @@ piglit_run_selected_subtests(const struct piglit_gl_subtest *all_subtests,
>   		for (i = 0; !PIGLIT_GL_SUBTEST_END(&all_subtests[i]); i++) {
>   			const enum piglit_result subtest_result =
>   				all_subtests[i].subtest_func(all_subtests[i].data);
> -			piglit_report_subtest_result(subtest_result,
> +			piglit_report_subtest_result(subtest_result, "%s",
>   						     all_subtests[i].name);
>
>   			piglit_merge_result(&result, subtest_result);
>

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



More information about the Piglit mailing list