Skip to content

Commit 73c843b

Browse files
IlanTruanovskypcolberg
authored andcommitted
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.
1 parent 67e23e1 commit 73c843b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/acl_platform_test.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include <CL/opencl.h>
1616

17+
#include <cinttypes>
1718
#include <stdio.h>
1819
#include <string>
1920
#include <vector>
@@ -204,7 +205,7 @@ MT_TEST(PlatformInfo, size) {
204205
ACL_LOCKED(debug_mode++);
205206
ACL_LOCKED(acl_print_debug_msg("\n"));
206207
#define SHOWSIZE(X) \
207-
ACL_LOCKED(acl_print_debug_msg(" sizeof(%-30s) = %8d\n", #X, sizeof(X)));
208+
ACL_LOCKED(acl_print_debug_msg(" sizeof(%-30s) = %8zu\n", #X, sizeof(X)));
208209

209210
SHOWSIZE(_cl_platform_id);
210211
SHOWSIZE(_cl_context);
@@ -388,8 +389,8 @@ TEST(offline_device, offline_hal) {
388389
// We might be testing on a machine that has this board!!!
389390
cl_ulong now;
390391
ACL_LOCKED(now = acl_get_hal()->get_timestamp());
391-
ACL_LOCKED(acl_print_debug_msg("offline hal time is %08x%08x", (now >> 32),
392-
(now & 0xffffffff)));
392+
ACL_LOCKED(acl_print_debug_msg("offline hal time is %08" PRIx64 "%08" PRIx64,
393+
(now >> 32), (now & 0xffffffff)));
393394
}
394395

395396
struct live_info_t {

0 commit comments

Comments
 (0)