Browse Source

Fix compiler warning (#706)

At compile time, gcc complains with:
../riscv/processor.cc:787:94: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]

The variable 'bits' is an uint64_t, so that PRIx64 should be used to print it out.
pull/713/head
jmonesti 5 years ago
committed by GitHub
parent
commit
dbd59e9bbf
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      riscv/processor.cc

4
riscv/processor.cc

@ -782,8 +782,8 @@ void processor_t::disasm(insn_t insn)
fprintf(log_file, "core %3d: Executed %" PRIx64 " times\n", id, executions);
}
fprintf(log_file, max_xlen==32 ? "core %3d: 0x%08" PRIx64 " (0x%08" PRIx32 ") %s\n" :
"core %3d: 0x%016" PRIx64 " (0x%08" PRIx32 ") %s\n",
fprintf(log_file, max_xlen==32 ? "core %3d: 0x%08" PRIx64 " (0x%08" PRIx64 ") %s\n" :
"core %3d: 0x%016" PRIx64 " (0x%08" PRIx64 ") %s\n",
id, ERASE_32MSB(max_xlen,state.pc), bits, disassembler->disassemble(insn).c_str());
last_pc = state.pc;
last_bits = bits;

Loading…
Cancel
Save