mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-11 17:36:08 +00:00
Numbers in C macros are treated as signed integer. This causes issues when using macro KB(x). If the result is larger than (2^31 - 1), it is treated as a negative number downstream. For example, the RAM size of up_squared is 2GB. The result of KB(CONFIG_SRAM_SIZE) should be 2147483648, but due to being casted as signed, the result is instead -2147483648. Any calculations using this would be incorrectly. Fix it by casting x in KB(x) to size_t first. Fixes #27164 Signed-off-by: Daniel Leung <daniel.leung@intel.com> |
||
---|---|---|
.. | ||
__assert.h | ||
arch_interface.h | ||
atomic.h | ||
base64.h | ||
byteorder.h | ||
check.h | ||
crc.h | ||
device_mmio.h | ||
dlist.h | ||
errno_private.h | ||
fdtable.h | ||
libc-hooks.h | ||
list_gen.h | ||
math_extras_impl.h | ||
math_extras.h | ||
mem_manage.h | ||
mempool_base.h | ||
mempool.h | ||
mutex.h | ||
notify.h | ||
onoff.h | ||
printk.h | ||
rb.h | ||
ring_buffer.h | ||
sem.h | ||
sflist.h | ||
slist.h | ||
speculation.h | ||
sys_heap.h | ||
sys_io.h | ||
thread_stack.h | ||
time_units.h | ||
timeutil.h | ||
util_internal.h | ||
util.h |