[Piglit] [PATCH] CL: Silence uninitialized use warning in switch(main_argument_type)
Jan Vesely
jan.vesely at rutgers.edu
Mon Sep 1 13:42:38 PDT 2014
On Mon, 2014-09-01 at 10:52 -0500, Aaron Watry wrote:
> Signed-off-by: Aaron Watry <awatry at gmail.com>
> ---
> tests/cl/program/program-tester.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tests/cl/program/program-tester.c b/tests/cl/program/program-tester.c
> index 0e35826..4798e59 100644
> --- a/tests/cl/program/program-tester.c
> +++ b/tests/cl/program/program-tester.c
> @@ -1546,6 +1546,7 @@ init(const int argc,
> config_file = piglit_cl_get_arg_value(argc, argv, "config");
> config_str = piglit_load_text_file(config_file, &config_str_size);
> } else {
> + main_argument_type = ARG_BINARY;
> fprintf(stderr, "Ops, this should not happen!\n");
> exit_report_result(PIGLIT_WARN);
> }
I know it's just to shut up clang warning, but I think it'd be better to
tell the compiler that exit_report_result does not return. See the
attached patches, they fix the problem for me (clang svn).
jan
--
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-noreturn-attribute-on-clang.patch
Type: text/x-patch
Size: 1014 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140901/90bb3fad/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-cl-Mark-exit_export_resutls-as-noreturn.patch
Type: text/x-patch
Size: 833 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140901/90bb3fad/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140901/90bb3fad/attachment.sig>
More information about the Piglit
mailing list