harness: Fix -Wformat warnings (#1527)

The main sources of warnings were:

 * Printing of a `size_t` which requires the `%zu` specifier.

 * Printing of `cl_long`/`cl_ulong` which is now done using the
   `PRI*64` macros to ensure portability across 32 and 64-bit builds.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2022-10-13 10:02:40 +01:00
committed by GitHub
parent 4b39b59469
commit f6a963a583
4 changed files with 14 additions and 11 deletions

View File

@@ -19,6 +19,7 @@
#include <assert.h>
#include <algorithm>
#include <cinttypes>
#include <vector>
static bool findProperty(const std::vector<cl_properties>& props,
@@ -97,16 +98,16 @@ int compareProperties(const std::vector<cl_properties>& queried,
if (!found)
{
log_error("ERROR: expected property 0x%llx not found!\n",
log_error("ERROR: expected property 0x%" PRIx64 " not found!\n",
check_prop);
return TEST_FAIL;
}
else if (check_value != queried_value)
{
log_error(
"ERROR: mis-matched value for property 0x%llx: wanted "
"0x%llx, got 0x%llx\n",
check_prop, check_value, queried_value);
log_error("ERROR: mis-matched value for property 0x%" PRIx64
": wanted "
"0x%" PRIx64 ", got 0x%" PRIx64 "\n",
check_prop, check_value, queried_value);
return TEST_FAIL;
}
}