From 73c843b7b470fc2fe0974017e7a04d3702a2b637 Mon Sep 17 00:00:00 2001 From: Ilan Truanovsky Date: Mon, 30 Jan 2023 13:47:07 -0800 Subject: [PATCH] Fix Coverity issues for `acl_platform_test.cpp` A macro had a PRINTF_ARGS Coverity issue, and so whenever the macro was used, Coverity detected an error. This meant that many errors were actually caused by the same problem. --- test/acl_platform_test.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/acl_platform_test.cpp b/test/acl_platform_test.cpp index 3ecf230c..5aa761ff 100644 --- a/test/acl_platform_test.cpp +++ b/test/acl_platform_test.cpp @@ -14,6 +14,7 @@ #include +#include #include #include #include @@ -204,7 +205,7 @@ MT_TEST(PlatformInfo, size) { ACL_LOCKED(debug_mode++); ACL_LOCKED(acl_print_debug_msg("\n")); #define SHOWSIZE(X) \ - ACL_LOCKED(acl_print_debug_msg(" sizeof(%-30s) = %8d\n", #X, sizeof(X))); + ACL_LOCKED(acl_print_debug_msg(" sizeof(%-30s) = %8zu\n", #X, sizeof(X))); SHOWSIZE(_cl_platform_id); SHOWSIZE(_cl_context); @@ -388,8 +389,8 @@ TEST(offline_device, offline_hal) { // We might be testing on a machine that has this board!!! cl_ulong now; ACL_LOCKED(now = acl_get_hal()->get_timestamp()); - ACL_LOCKED(acl_print_debug_msg("offline hal time is %08x%08x", (now >> 32), - (now & 0xffffffff))); + ACL_LOCKED(acl_print_debug_msg("offline hal time is %08" PRIx64 "%08" PRIx64, + (now >> 32), (now & 0xffffffff))); } struct live_info_t {