Skip to content

Commit

Permalink
Fix mismatched print format (#14517)
Browse files Browse the repository at this point in the history
Caught by GCC Wformat=
  • Loading branch information
hcindyl authored Jul 29, 2023
1 parent cc3e5f3 commit 43774f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tools/iree-cpuinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions tools/iree-dump-instruments-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -199,15 +199,15 @@ 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;
}
case IREE_INSTRUMENT_DISPATCH_TYPE_MEMORY_STORE: {
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;
}
Expand Down

0 comments on commit 43774f6

Please sign in to comment.