Skip to content

Commit efc9cee

Browse files
evgeniy-paltsevnashif
authored andcommitted
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: fe2075d "shell: Add __printf_like to shell_fprintf" Signed-off-by: Eugeniy Paltsev <[email protected]> Signed-off-by: Evgeniy Paltsev <[email protected]>
1 parent 74ad991 commit efc9cee

File tree

1 file changed

+4
-4
lines changed
  • samples/subsys/shell/shell_module/src

1 file changed

+4
-4
lines changed

samples/subsys/shell/shell_module/src/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,19 @@ static int cmd_demo_getopt(const struct shell *shell, size_t argc, char **argv)
154154

155155
static int cmd_demo_params(const struct shell *shell, size_t argc, char **argv)
156156
{
157-
shell_print(shell, "argc = %d", argc);
157+
shell_print(shell, "argc = %zd", argc);
158158
for (size_t cnt = 0; cnt < argc; cnt++) {
159-
shell_print(shell, " argv[%d] = %s", cnt, argv[cnt]);
159+
shell_print(shell, " argv[%zd] = %s", cnt, argv[cnt]);
160160
}
161161

162162
return 0;
163163
}
164164

165165
static int cmd_demo_hexdump(const struct shell *shell, size_t argc, char **argv)
166166
{
167-
shell_print(shell, "argc = %d", argc);
167+
shell_print(shell, "argc = %zd", argc);
168168
for (size_t cnt = 0; cnt < argc; cnt++) {
169-
shell_print(shell, "argv[%d]", cnt);
169+
shell_print(shell, "argv[%zd]", cnt);
170170
shell_hexdump(shell, argv[cnt], strlen(argv[cnt]));
171171
}
172172

0 commit comments

Comments
 (0)