Skip to content

Commit

Permalink
vectors: fix -Wformat warnings (KhronosGroup#1910)
Browse files Browse the repository at this point in the history
Use the `z` length modifier for printing `size_t` types.

Also fix a typo in the error messages.

Signed-off-by: Sven van Haastregt <[email protected]>
  • Loading branch information
svenvh authored Mar 8, 2024
1 parent 6a60db5 commit 1f0fa08
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test_conformance/vectors/structs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,9 @@ int checkCorrectnessAlign(bufferStruct *pBufferStruct, clState *pClState,
{
if ((targetArr[i]) % minAlign != (cl_uint)0)
{
vlog_error("Error %d (of %d). Expected a multple of %x, got %x\n",
i, pClState->m_numThreads, minAlign, targetArr[i]);
vlog_error(
"Error %zu (of %zu). Expected a multiple of %zx, got %x\n", i,
pClState->m_numThreads, minAlign, targetArr[i]);
return -1;
}
}
Expand Down Expand Up @@ -387,10 +388,10 @@ int checkPackedCorrectness(bufferStruct *pBufferStruct, clState *pClState,
{
if ((targetArr[i] - beforeSize) % totSize != (cl_uint)0)
{
vlog_error("Error %d (of %d). Expected %d more than a multple of "
"%d, got %d \n",
i, pClState->m_numThreads, beforeSize, totSize,
targetArr[i]);
vlog_error(
"Error %zu (of %zu). Expected %zu more than a multiple of "
"%zu, got %d \n",
i, pClState->m_numThreads, beforeSize, totSize, targetArr[i]);
return -1;
}
}
Expand Down

0 comments on commit 1f0fa08

Please sign in to comment.