zephyr/tests/unit
Nicolas Pitre 5a384b9ea8 lib/os/cbprintf_nano.c: avoid sign extension on unsigned formats
There might be a sign extension when a long is promoted to
int_value_type and the former type is smaller than the later.
This produces the wrong output if the specified format is unsigned.

Let's avoid this problem by handling signed and unsigned cases
explicitly. When the type already matches int_value_type then the
compiler is smart enough to recognize the redundancy and removes
unneeded duplications automatically, meaning that the code will stay
small when code size matters.

A similar issue also existed in the restricted %llu case.
The fix is the same as above.

Those fixes exposed wrong results in the printk.c test with %llx
so fix that as well.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-09-02 19:37:06 -04:00
..
base64
cbprintf lib/os/cbprintf_nano.c: avoid sign extension on unsigned formats 2021-09-02 19:37:06 -04:00
crc
intmath
list
math_extras
net_timeout
rbtree
timeutil tests: timeutil: test large linearity 2021-08-08 08:18:23 -04:00
util