Fix format warning by PRIu32 in [wasm|aot] dump call stack (#2251)

This commit is contained in:
Huang Qi 2023-06-11 11:30:25 +08:00 committed by GitHub
parent 92e073b8ce
commit 7ec77598dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 8 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
.cache
.clangd
.vs
.vscode
.venv

View File

@ -2797,11 +2797,13 @@ aot_dump_call_stack(WASMExecEnv *exec_env, bool print, char *buf, uint32 len)
/* function name not exported, print number instead */
if (frame.func_name_wp == NULL) {
line_length = snprintf(line_buf, sizeof(line_buf), "#%02d $f%d\n",
n, frame.func_index);
line_length =
snprintf(line_buf, sizeof(line_buf),
"#%02" PRIu32 " $f%" PRIu32 "\n", n, frame.func_index);
}
else {
line_length = snprintf(line_buf, sizeof(line_buf), "#%02d %s\n", n,
line_length =
snprintf(line_buf, sizeof(line_buf), "#%02" PRIu32 " %s\n", n,
frame.func_name_wp);
}

View File

@ -3048,11 +3048,13 @@ wasm_interp_dump_call_stack(struct WASMExecEnv *exec_env, bool print, char *buf,
/* function name not exported, print number instead */
if (frame.func_name_wp == NULL) {
line_length = snprintf(line_buf, sizeof(line_buf), "#%02d $f%d\n",
n, frame.func_index);
line_length =
snprintf(line_buf, sizeof(line_buf),
"#%02" PRIu32 " $f%" PRIu32 "\n", n, frame.func_index);
}
else {
line_length = snprintf(line_buf, sizeof(line_buf), "#%02d %s\n", n,
line_length =
snprintf(line_buf, sizeof(line_buf), "#%02" PRIu32 " %s\n", n,
frame.func_name_wp);
}