From efc9cee8341fcefef06daea427b965d1808a9dd7 Mon Sep 17 00:00:00 2001 From: Evgeniy Paltsev Date: Mon, 18 Oct 2021 15:43:26 +0300 Subject: [PATCH] samples: shell_module: fix build on 64bit platforms After the __printf_like validation was added to the shell_fprintf functions we got warnings while building the 'samples/subsys/shell/shell_module' due to incorrect specifiers while printing size_t variables. Fix that. Fixes: #39386 Fixes: fe2075d140 "shell: Add __printf_like to shell_fprintf" Signed-off-by: Eugeniy Paltsev Signed-off-by: Evgeniy Paltsev --- samples/subsys/shell/shell_module/src/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/subsys/shell/shell_module/src/main.c b/samples/subsys/shell/shell_module/src/main.c index cca30371af1..f54a0fa93a8 100644 --- a/samples/subsys/shell/shell_module/src/main.c +++ b/samples/subsys/shell/shell_module/src/main.c @@ -154,9 +154,9 @@ static int cmd_demo_getopt(const struct shell *shell, size_t argc, char **argv) static int cmd_demo_params(const struct shell *shell, size_t argc, char **argv) { - shell_print(shell, "argc = %d", argc); + shell_print(shell, "argc = %zd", argc); for (size_t cnt = 0; cnt < argc; cnt++) { - shell_print(shell, " argv[%d] = %s", cnt, argv[cnt]); + shell_print(shell, " argv[%zd] = %s", cnt, argv[cnt]); } return 0; @@ -164,9 +164,9 @@ static int cmd_demo_params(const struct shell *shell, size_t argc, char **argv) static int cmd_demo_hexdump(const struct shell *shell, size_t argc, char **argv) { - shell_print(shell, "argc = %d", argc); + shell_print(shell, "argc = %zd", argc); for (size_t cnt = 0; cnt < argc; cnt++) { - shell_print(shell, "argv[%d]", cnt); + shell_print(shell, "argv[%zd]", cnt); shell_hexdump(shell, argv[cnt], strlen(argv[cnt])); }