zephyr/lib/os
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
..
CMakeLists.txt sys: introduce bit arrays 2021-05-07 13:36:22 -04:00
Kconfig lib: os: Removed deprecated Kconfig PRINTK64 symbol 2021-06-11 16:35:19 -05:00
Kconfig.cbprintf lib: os: cbprintf: Add dependency to cbprintf Kconfig 2021-07-21 07:46:39 -04:00
assert.c userspace: rename _is_user_context -> k_is_user_context 2021-04-01 05:34:17 -04:00
base64.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
bitarray.c sys: introduce bit arrays 2021-05-07 13:36:22 -04:00
cbprintf.c lib: cbprintf: add libc f/printf substitutes 2021-01-27 13:34:06 -05:00
cbprintf_complete.c lib: add default labels and comments to switch statements 2021-06-04 16:22:23 -05:00
cbprintf_nano.c lib/os/cbprintf_nano.c: avoid sign extension on unsigned formats 2021-09-02 19:37:06 -04:00
cbprintf_packaged.c linker: align _image_rodata and _image_rom start/end/size linker symbols 2021-08-28 08:48:03 -04:00
crc7_sw.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
crc8_sw.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
crc16_sw.c lib: os: cast to the same size composite expression 2021-07-23 15:53:30 -04:00
crc32_sw.c lib: os: cast to the same size composite expression 2021-07-23 15:53:30 -04:00
crc32c_sw.c lib: os: cast to the same size composite expression 2021-07-23 15:53:30 -04:00
dec.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
fdtable.c ARC: LIB: MWDT: add stdout hooks, timespec header 2021-08-13 13:43:19 -05:00
heap-validate.c lib: os: heap-validate: Fix wrong chunkid returned by max_chunkid() 2021-06-23 06:18:44 -04:00
heap.c k_heap: Clamp to a minimum heap size 2021-05-20 17:52:21 -04:00
heap.h heap: create unique variable name 2021-05-25 19:06:06 -04:00
hex.c lib: hex: Remove constant expression 2020-09-02 13:45:50 -04:00
json.c json: fix parsing first array-array element 2021-08-16 15:11:20 -04:00
mpsc_pbuf.c lib: remove redundant check for null 2021-05-26 08:29:20 -05:00
mutex.c lib: os: Simplify z_impl_z_sys_mutex_kernel_unlock 2021-03-10 05:42:06 -05:00
notify.c lib: os: assign sys_notify callback default to NULL... 2021-04-29 07:16:37 -04:00
onoff.c lib: os: add final else where missing in onoff, p4wq, sem 2021-04-28 20:28:19 -04:00
p4wq.c toolchain: migrate iterable sections calls to the external API 2021-08-12 17:47:04 -04:00
printk.c logging: Adapt logger to support both versions 2021-04-19 10:59:23 -04:00
rb.c lib: rb: Fix violations to rule 12.1 2021-04-20 15:50:49 -04:00
reboot.c lib: os: add gcc noreturn attribute for sys_reboot 2021-08-13 07:32:51 -04:00
ring_buffer.c lib: os: ring_buffer: Fix race condition 2021-08-17 19:52:08 +02:00
sem.c lib: os: add final else where missing in onoff, p4wq, sem 2021-04-28 20:28:19 -04:00
thread_entry.c kernel: make k_current_get() work without syscall 2021-07-30 20:16:47 -04:00
timeutil.c lib: timeutil: fix conversion drift 2021-08-08 08:18:23 -04:00
user_work.c kernel: provide functional equivalent to old userspace work queue API 2021-03-03 20:06:00 -05:00