From 7f89a45ad724888b111227127b14a48e0b5e48ad Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Mon, 10 Jun 2024 21:27:19 +0200 Subject: [PATCH] cxxxrtl: fix use of format specifiers in test This fix a few instances of incorrect (and non-portable) use of format specifiers. --- tests/cxxrtl/test_value_fuzz.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/cxxrtl/test_value_fuzz.cc b/tests/cxxrtl/test_value_fuzz.cc index a7bbb293afc..7e8fbb0a926 100644 --- a/tests/cxxrtl/test_value_fuzz.cc +++ b/tests/cxxrtl/test_value_fuzz.cc @@ -1,3 +1,4 @@ +#include #include #include #include @@ -62,17 +63,17 @@ void test_binary_operation_for_bitsize(Operation &op) for (size_t i = 0; i * chunk_bits < Bits; i++) { if ((chunk_type)(iresult >> (i * chunk_bits)) != vresult.data[i]) { std::printf("Test failure:\n"); - std::printf("Bits: %i\n", Bits); - std::printf("a: %016lx\n", ia); - std::printf("b: %016lx\n", ib); - std::printf("iresult: %016lx\n", iresult); - std::printf("vresult: %016lx\n", vresult.template get()); + std::printf("Bits: %zu\n", Bits); + std::printf("a: %016" PRIx64 "\n", ia); + std::printf("b: %016" PRIx64 "\n", ib); + std::printf("iresult: %016" PRIx64 "\n", iresult); + std::printf("vresult: %016" PRIx64 "\n", vresult.template get()); std::terminate(); } } } - std::printf("Test passed @ Bits = %i.\n", Bits); + std::printf("Test passed @ Bits = %zu.\n", Bits); } template