From 43774f6179b04a62be1b4d0f65f982a8b0f5ff07 Mon Sep 17 00:00:00 2001 From: CindyLiu Date: Fri, 28 Jul 2023 23:35:38 -0700 Subject: [PATCH] Fix mismatched print format (#14517) Caught by GCC Wformat= --- tools/iree-cpuinfo.c | 2 +- tools/iree-dump-instruments-main.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/iree-cpuinfo.c b/tools/iree-cpuinfo.c index f5324d09b9f9..8d22161644e2 100644 --- a/tools/iree-cpuinfo.c +++ b/tools/iree-cpuinfo.c @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) { #define IREE_CPU_FEATURE_BIT(arch, field_index, bit_pos, bit_name, llvm_name) \ if (IREE_ARCH_ENUM == IREE_ARCH_ENUM_##arch) { \ bool result = (cpu_data[field_index] & (1ull << bit_pos)) != 0; \ - printf("%-20s %ld\n", llvm_name, result); \ + printf("%-20s %d\n", llvm_name, (int)result); \ } #include "iree/schemas/cpu_feature_bits.inl" #undef IREE_CPU_FEATURE_BIT diff --git a/tools/iree-dump-instruments-main.c b/tools/iree-dump-instruments-main.c index 8c219e14217d..60d07b93742e 100644 --- a/tools/iree-dump-instruments-main.c +++ b/tools/iree-dump-instruments-main.c @@ -180,16 +180,16 @@ static iree_status_t iree_tooling_dump_dispatch_ringbuffer( const iree_instrument_dispatch_print_t* print = (const iree_instrument_dispatch_print_t*)header; fprintf(stream, "%016" PRIX64 " | PRINT %.*s\n", - print->workgroup_offset, (int)print->length, print->data); + (uint64_t)print->workgroup_offset, (int)print->length, + print->data); i += iree_host_align(sizeof(*print) + print->length, 16); break; } case IREE_INSTRUMENT_DISPATCH_TYPE_VALUE: { const iree_instrument_dispatch_value_t* value = (const iree_instrument_dispatch_value_t*)header; - fprintf(stream, - "%016" PRIX64 " | VALUE %04u = ", value->workgroup_offset, - (uint32_t)value->ordinal); + fprintf(stream, "%016" PRIX64 " | VALUE %04u = ", + (uint64_t)value->workgroup_offset, (uint32_t)value->ordinal); iree_tooling_dump_print_value(value->type, value->bits, stream); fputc('\n', stream); i += sizeof(*value); @@ -199,7 +199,7 @@ static iree_status_t iree_tooling_dump_dispatch_ringbuffer( const iree_instrument_dispatch_memory_op_t* op = (const iree_instrument_dispatch_memory_op_t*)header; fprintf(stream, "%016" PRIX64 " | LOAD %016" PRIX64 " %u\n", - op->workgroup_offset, op->address, (int)op->length); + (uint64_t)op->workgroup_offset, op->address, (int)op->length); i += sizeof(*op); break; } @@ -207,7 +207,7 @@ static iree_status_t iree_tooling_dump_dispatch_ringbuffer( const iree_instrument_dispatch_memory_op_t* op = (const iree_instrument_dispatch_memory_op_t*)header; fprintf(stream, "%016" PRIX64 " | STORE %016" PRIX64 " %u\n", - op->workgroup_offset, op->address, (int)op->length); + (uint64_t)op->workgroup_offset, op->address, (int)op->length); i += sizeof(*op); break; }