shell: inability to print 64-bit integers with newlib support #29363
Labels
area: Shell
Shell subsystem
bug
The issue is a bug, or the PR is fixing a bug
priority: medium
Medium impact/importance bug
Stale
Describe the bug
When
CONFIG_NEWLIB_LIBC=y
is used, the shell printf is unable to substitute the%lu
specifier.To Reproduce
Steps to reproduce the behavior:
cd samples/subsys/shell/shell_module
Add
CONFIG_NEWLIB_LIBC=y
toprj.conf
Add the following lines to any command handler:
west build -b nrf52840dk_nrf52840 -p && west flash
Execute the command
Observe, that
%lu
is displayed instead of a number.Expected behavior
The specifier is correctly substituted with a 64-bit value.
Impact
Inability to print 64-bit values with the shell.
Logs and console output
Output shown above.
Environment (please complete the following information):
gcc-arm-none-eabi-9-2019-q4-major
4d0750920b52e0ce8a3e188d08a1769ff7ec527b
Additional context
The value used to be printed correctly with values less than 2^32.
git bisect
points to:It appears, that the
z_vprintk
used previously could substitute%lu
, but only up to 2^32-1. Thez_prf
also has this ability (without the limitation), but it is blocked behindCONFIG_MINIMAL_LIBC_LL_PRINTF
which can't be enabled due toCONFIG_NEWLIB_LIBC=y
.The text was updated successfully, but these errors were encountered: