Skip to content

Commit 4f9fa25

Browse files
Fix PRINTF_ARGS Coverity issues
Fixes: ``` test/acl_device_test.cpp:350:7: Type: Invalid type in argument to printf format specifier (PRINTF_ARGS) test/acl_device_test.cpp:350:7: invalid_type: Argument "value" to format specifier "%8x" was expected to have type "unsigned 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_device_test.cpp:360:7: Type: Invalid type in argument to printf format specifier (PRINTF_ARGS) test/acl_device_test.cpp:360:7: invalid_type: Argument "value" to format specifier "%8x" was expected to have type "unsigned 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 7a81c63 commit 4f9fa25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/acl_device_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ MT_TEST(DeviceInfo, basic) {
347347
CHECK_EQUAL(sizeof(cl_bitfield), size_ret);
348348
cl_bitfield *ptr = (cl_bitfield *)&str[0];
349349
cl_bitfield value = *ptr;
350-
ACL_LOCKED(acl_print_debug_msg("queue prop %8x\n", value));
350+
ACL_LOCKED(acl_print_debug_msg("queue prop %8lx\n", value));
351351
CHECK_EQUAL(CL_QUEUE_PROFILING_ENABLE |
352352
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE,
353353
value);
@@ -357,7 +357,7 @@ MT_TEST(DeviceInfo, basic) {
357357
CHECK_EQUAL(sizeof(cl_bitfield), size_ret);
358358
cl_bitfield *ptr = (cl_bitfield *)&str[0];
359359
cl_bitfield value = *ptr;
360-
ACL_LOCKED(acl_print_debug_msg("fp config %8x\n", value));
360+
ACL_LOCKED(acl_print_debug_msg("fp config %8lx\n", value));
361361
CHECK_EQUAL((CL_FP_INF_NAN | CL_FP_ROUND_TO_NEAREST), value);
362362
}
363363
// Check sanity of device avail

0 commit comments

Comments
 (0)