basic: fix Wformat warnings (#2343)

Fix all `-Wformat` warnings in the basic test suite, and re-enable the
warning.

---------

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2025-03-25 17:45:18 +01:00
committed by GitHub
parent 1cbb548e27
commit b6924adfb2
8 changed files with 112 additions and 43 deletions

View File

@@ -17,6 +17,8 @@
#include <unistd.h>
#endif
#include <cinttypes>
#include "harness/conversions.h"
#include "harness/typeWrappers.h"
#include "harness/errorHelpers.h"
@@ -315,9 +317,14 @@ static int test_kernel_memory_alignment(cl_device_id device, cl_context context,
for (int i = 0; i < 6; i++) {
if ((results_data[i] & alignments[i]) != 0) {
total_errors++;
log_error("\tVector size %d failed: 0x%llx is not properly aligned.\n", 1 << i, results_data[i]);
log_error("\tVector size %d failed: 0x%" PRIx64
" is not properly aligned.\n",
1 << i, results_data[i]);
} else {
if (DEBUG) log_info("\tVector size %d passed: 0x%llx is properly aligned.\n", 1 << i, results_data[i]);
if (DEBUG)
log_info("\tVector size %d passed: 0x%" PRIx64
" is properly aligned.\n",
1 << i, results_data[i]);
}
}
}
@@ -328,9 +335,14 @@ static int test_kernel_memory_alignment(cl_device_id device, cl_context context,
for (int i = 0; i < 6; i++) {
if ((results_data_no_long[i] & alignments[i]) != 0) {
total_errors++;
log_error("\tVector size %d failed: 0x%llx is not properly aligned.\n", 1 << i, results_data_no_long[i]);
log_error("\tVector size %d failed: 0x%x is not "
"properly aligned.\n",
1 << i, results_data_no_long[i]);
} else {
if (DEBUG) log_info("\tVector size %d passed: 0x%llx is properly aligned.\n", 1 << i, results_data_no_long[i]);
if (DEBUG)
log_info("\tVector size %d passed: 0x%x is "
"properly aligned.\n",
1 << i, results_data_no_long[i]);
}
}
}
@@ -383,9 +395,14 @@ static int test_kernel_memory_alignment(cl_device_id device, cl_context context,
for (int i = 0; i < 5; i++) {
if ((results_data[i] & alignments[i]) != 0) {
total_errors++;
log_error("\tVector size %d failed: 0x%llx is not properly aligned.\n", 1 << i, results_data[i]);
log_error("\tVector size %d failed: 0x%" PRIx64
" is not properly aligned.\n",
1 << i, results_data[i]);
} else {
if (DEBUG) log_info("\tVector size %d passed: 0x%llx is properly aligned.\n", 1 << i, results_data[i]);
if (DEBUG)
log_info("\tVector size %d passed: 0x%" PRIx64
" is properly aligned.\n",
1 << i, results_data[i]);
}
}
}
@@ -396,9 +413,14 @@ static int test_kernel_memory_alignment(cl_device_id device, cl_context context,
for (int i = 0; i < 5; i++) {
if ((results_data_no_long[i] & alignments[i]) != 0) {
total_errors++;
log_error("\tVector size %d failed: 0x%llx is not properly aligned.\n", 1 << i, results_data_no_long[i]);
log_error("\tVector size %d failed: 0x%x is not "
"properly aligned.\n",
1 << i, results_data_no_long[i]);
} else {
if (DEBUG) log_info("\tVector size %d passed: 0x%llx is properly aligned.\n", 1 << i, results_data_no_long[i]);
if (DEBUG)
log_info("\tVector size %d passed: 0x%x is "
"properly aligned.\n",
1 << i, results_data_no_long[i]);
}
}
}
@@ -455,9 +477,14 @@ static int test_kernel_memory_alignment(cl_device_id device, cl_context context,
for (int i = 0; i < 5; i++) {
if ((results_data[i] & alignments[i]) != 0) {
total_errors++;
log_error("\tVector size %d failed: 0x%llx is not properly aligned.\n", 1 << i, results_data[i]);
log_error("\tVector size %d failed: 0x%" PRIx64
" is not properly aligned.\n",
1 << i, results_data[i]);
} else {
if (DEBUG) log_info("\tVector size %d passed: 0x%llx is properly aligned.\n", 1 << i, results_data[i]);
if (DEBUG)
log_info("\tVector size %d passed: 0x%" PRIx64
" is properly aligned.\n",
1 << i, results_data[i]);
}
}
}
@@ -468,9 +495,14 @@ static int test_kernel_memory_alignment(cl_device_id device, cl_context context,
for (int i = 0; i < 5; i++) {
if ((results_data_no_long[i] & alignments[i]) != 0) {
total_errors++;
log_error("\tVector size %d failed: 0x%llx is not properly aligned.\n", 1 << i, results_data_no_long[i]);
log_error("\tVector size %d failed: 0x%x is not "
"properly aligned.\n",
1 << i, results_data_no_long[i]);
} else {
if (DEBUG) log_info("\tVector size %d passed: 0x%llx is properly aligned.\n", 1 << i, results_data_no_long[i]);
if (DEBUG)
log_info("\tVector size %d passed: 0x%x is "
"properly aligned.\n",
1 << i, results_data_no_long[i]);
}
}
}