From 896f43615dfcb00b95e52f8ff42c72333a05285d Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Wed, 11 Jan 2023 10:25:30 +0000 Subject: [PATCH] basic: Return error on unhandled image format (#1613) Fail when an unhandled image format is encountered instead of continuing validation with uninitialized variables. Fixes a `-Wsometimes-uninitialized` warning for e.g. the `tolerance` variable. Signed-off-by: Sven van Haastregt --- test_conformance/basic/test_image_param.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test_conformance/basic/test_image_param.cpp b/test_conformance/basic/test_image_param.cpp index c8fc1b4a..3efc4c94 100644 --- a/test_conformance/basic/test_image_param.cpp +++ b/test_conformance/basic/test_image_param.cpp @@ -117,7 +117,8 @@ int validate_results( size_t width, size_t height, cl_image_format &format, char } default: // Should never get here - break; + log_error("Unhandled channel data type\n"); + return -1; } if( format.image_channel_order == CL_BGRA )