Cleanup output format warnings (#904)

Use `PRIxxx` related macros to format the output strings so as to clear
compile warnings, e.g. PRIu32, PRId32, PRIX32, PRIX64 and so on.
And add the related macro definitions in platform_common.h if they
are not defined, as some compilers might not support them.
This commit is contained in:
Huang Qi
2021-12-20 15:51:36 +08:00
committed by GitHub
parent a41c1ad85c
commit 4cc4625a2b
9 changed files with 74 additions and 26 deletions

View File

@ -2490,12 +2490,12 @@ aot_load_const_from_table(AOTCompContext *comp_ctx, LLVMValueRef base,
switch (value_type) {
case VALUE_TYPE_F32:
/* Store the raw int bits of f32 const as a hex string */
snprintf(buf, sizeof(buf), "f32#%08X", value->i32);
snprintf(buf, sizeof(buf), "f32#%08" PRIX32, value->i32);
const_ptr_type = F32_PTR_TYPE;
break;
case VALUE_TYPE_F64:
/* Store the raw int bits of f64 const as a hex string */
snprintf(buf, sizeof(buf), "f64#%016" PRIx64, value->i64);
snprintf(buf, sizeof(buf), "f64#%016" PRIX64, value->i64);
const_ptr_type = F64_PTR_TYPE;
break;
default: