Skip to content

i3c: shell: build failure on qemu_cortex_m3 platform #78990

@LaurentiuM1234

Description

@LaurentiuM1234

Describe the bug
Commit ffb60c0 enables the I3C shell, which doesn't build on the qemu_cortex_m3 platform. This leads to some twister tests failing with the following error:

/__w/zephyr/zephyr/drivers/i3c/i3c_shell.c: In function 'cmd_i3c_ccc_rstact':
/__w/zephyr/zephyr/drivers/i3c/i3c_shell.c:1074:46: error: passing argument 1 of 'i3c_ccc_do_rstact_fmt3' from incompatible pointer type [-Werror=incompatible-pointer-types]
 1074 |                 ret = i3c_ccc_do_rstact_fmt3(tdev, action, &data);
      |                                              ^~~~
      |                                              |
      |                                              const struct device *
In file included from /__w/zephyr/zephyr/include/zephyr/drivers/i3c.h:26,
                 from /__w/zephyr/zephyr/drivers/i3c/i3c_shell.c:7:
/__w/zephyr/zephyr/include/zephyr/drivers/i3c/ccc.h:1392:72: note: expected 'const struct i3c_device_desc *' but argument is of type 'const struct device *'
 1392 | static inline int i3c_ccc_do_rstact_fmt3(const struct i3c_device_desc *target,
      |                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/__w/zephyr/zephyr/drivers/i3c/i3c_shell.c:1076:46: error: passing argument 1 of 'i3c_ccc_do_rstact_fmt2' from incompatible pointer type [-Werror=incompatible-pointer-types]
 1076 |                 ret = i3c_ccc_do_rstact_fmt2(tdev, action);
      |                                              ^~~~
      |                                              |
      |                                              const struct device *
/__w/zephyr/zephyr/include/zephyr/drivers/i3c/ccc.h:1374:72: note: expected 'const struct i3c_device_desc *' but argument is of type 'const struct device *'
 1374 | static inline int i3c_ccc_do_rstact_fmt2(const struct i3c_device_desc *target,
      |                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /__w/zephyr/zephyr/drivers/i3c/i3c_shell.c:8:
/__w/zephyr/zephyr/include/zephyr/shell/shell.h:1109:39: error: expected ')' before string constant
 1109 |         shell_fprintf_normal(_sh, _ft "\n", ##__VA_ARGS__)
      |                             ~         ^~~~
/__w/zephyr/zephyr/drivers/i3c/i3c_shell.c:1088:17: note: in expansion of macro 'shell_print'
 1088 |                 shell_print("RSTACT Returned Data: 0x%02x", data);
      |                 ^~~~~~~~~~~
/__w/zephyr/zephyr/drivers/i3c/i3c_shell.c:1088:29: error: passing argument 1 of 'shell_fprintf_normal' from incompatible pointer type [-Werror=incompatible-pointer-types]
 1088 |                 shell_print("RSTACT Returned Data: 0x%02x", data);
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                             |
      |                             char *
/__w/zephyr/zephyr/include/zephyr/shell/shell.h:1109:30: note: in definition of macro 'shell_print'
 1109 |         shell_fprintf_normal(_sh, _ft "\n", ##__VA_ARGS__)
      |                              ^~~
/__w/zephyr/zephyr/include/zephyr/shell/shell.h:1110:67: note: expected 'const struct shell *' but argument is of type 'char *'
 1110 | void __printf_like(2, 3) shell_fprintf_normal(const struct shell *sh, const char *fmt, ...);
      |                                               ~~~~~~~~~~~~~~~~~~~~^~
/__w/zephyr/zephyr/drivers/i3c/i3c_shell.c:1088:61: error: passing argument 2 of 'shell_fprintf_normal' makes pointer from integer without a cast [-Werror=int-conversion]
 1088 |                 shell_print("RSTACT Returned Data: 0x%02x", data);
      |                                                             ^~~~
      |                                                             |
      |                                                             uint8_t {aka unsigned char}
/__w/zephyr/zephyr/include/zephyr/shell/shell.h:1109:35: note: in definition of macro 'shell_print'
 1109 |         shell_fprintf_normal(_sh, _ft "\n", ##__VA_ARGS__)
      |                                   ^~~
/__w/zephyr/zephyr/include/zephyr/shell/shell.h:1110:83: note: expected 'const char *' but argument is of type 'uint8_t' {aka 'unsigned char'}
 1110 | void __printf_like(2, 3) shell_fprintf_normal(const struct shell *sh, const char *fmt, ...);
      |                                                                       ~~~~~~~~~~~~^~~
/__w/zephyr/zephyr/drivers/i3c/i3c_shell.c:1088:17: error: format not a string literal and no format arguments [-Werror=format-security]
 1088 |                 shell_print("RSTACT Returned Data: 0x%02x", data);
      |                 ^~~~~~~~~~~
cc1: all warnings being treated as errors
ninja: build stopped: subcommand failed.

To Reproduce
Run west build -p -b qemu_cortex_m3 tests/drivers/build_all/i3c/. The build should fail with the same error as shown above.

Expected behavior
The build shouldn't fail.

Impact
Annoyance mostly. It's blocking PRs because of the twister failures.

Proposed fix
For now this should be reverted to unblock PRs. Revert in #78986.

Metadata

Metadata

Labels

area: I3CbugThe issue is a bug, or the PR is fixing a bugpriority: highHigh impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions