Skip to content

Commit 55f211a

Browse files
IlanTruanovskypcolberg
authored andcommitted
Fix Coverity issues in acl_kernel_test.cpp
Fixes: ``` test/acl_kernel_test.cpp:2106:32: Type: Invalid type in argument to printf format specifier (PRINTF_ARGS) test/acl_kernel_test.cpp:2106:32: invalid_type: Argument "local_sizes[itry]" to format specifier "%d" was expected to have type "int" but has type "unsigned long". src/acl_hal.cpp:123:3: path: Condition "debug_mode > 0", taking true branch. src/acl_hal.cpp:126:5: printf_function: Calling "vprintf" which uses a "printf"-style format string. [Note: The source code implementation of the function has been overridden by a builtin model.] test/acl_kernel_test.cpp:2138:27: Type: Invalid type in argument to printf format specifier (PRINTF_ARGS) test/acl_kernel_test.cpp:2138:27: invalid_type: Argument "local_sizes[itry]" to format specifier "%d" was expected to have type "int" but has type "unsigned long". src/acl_hal.cpp:123:3: path: Condition "debug_mode > 0", taking true branch. src/acl_hal.cpp:126:5: printf_function: Calling "vprintf" which uses a "printf"-style format string. [Note: The source code implementation of the function has been overridden by a builtin model.] ```
1 parent fea1719 commit 55f211a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/acl_kernel_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,7 +2103,7 @@ TEST(acl_kernel, local_arg_alloc) {
21032103
for (size_t itry = 0; itry < sizeof(local_sizes) / sizeof(local_sizes[0]);
21042104
++itry) {
21052105
const int second_local_size = 1; // doesn't matter, as long as it's positive
2106-
acl_print_debug_msg("%d ", local_sizes[itry]);
2106+
acl_print_debug_msg("%zu ", local_sizes[itry]);
21072107
CHECK_EQUAL(CL_SUCCESS, clSetKernelArg(kernel, 1, local_sizes[itry], 0));
21082108
CHECK_EQUAL(CL_SUCCESS, clSetKernelArg(kernel, 2, second_local_size, 0));
21092109

@@ -2134,7 +2134,7 @@ TEST(acl_kernel, local_arg_alloc) {
21342134
}
21352135
CHECK_EQUAL(0, arg[0]);
21362136
CHECK_EQUAL(0, arg[3]);
2137-
acl_print_debug_msg(" local args ( %d, %d ) -> %x, %x -> delta %d \n",
2137+
acl_print_debug_msg(" local args ( %zu, %d ) -> %x, %x -> delta %d \n",
21382138
local_sizes[itry], second_local_size, arg[1], arg[2],
21392139
arg[2] - arg[1]);
21402140
CHECK(arg[1] != arg[2]);

0 commit comments

Comments
 (0)