zephyr/tests/lib
Krzysztof Chruscinski a7224830ce lib: os: cbprintf: Mechanism for detecting %p in static package
Static packaging is using only argument types to build a package. There
is one case where analysing argument type only is not enough to
determine package content. That is %p with (unsigned) char pointer vs
%s. In case of %s a string might need to be appended to the package
and in case of %p it must be avoided. Format string analysis is required
to distinguish those two cases.
In order to speed up the runtime inspection, additional information is
added to a static package. That is index of the string argument (where
first argument has index 0). This information allows quick format string
inspection where nth format specifier is found and checked if it is a
pointer format specifier.
Inspection algorithm is added to cbprintf_package_convert() and if %p
is found then data for that argument is discarded. Additionally, log
warning is printed with suggestion to cast pointer argument to void *
to avoid confusion. It is desired to get rid of this ambiguity because
there are going to be logging configurations where strings are stripped
from a binary and runtime inspection cannot be performed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-09-19 10:14:23 +00:00
..
c_lib ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
cbprintf_fp tests: Add picolibc tests 2022-06-22 13:15:55 +02:00
cbprintf_package lib: os: cbprintf: Mechanism for detecting %p in static package 2022-09-19 10:14:23 +00:00
cmsis_dsp tests: lib: move the cmsis_dsp transform test to new ztest API 2022-09-14 07:22:09 -04:00
cmsis_nn includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
devicetree tests: devicetree: add bits to test multi-bus nodes 2022-09-09 17:42:33 -04:00
fdtable ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
gui/lvgl tests: lib: gui: lvgl: Switch to FIXED_PARTITION_ macros 2022-09-06 09:56:37 +02:00
heap includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
heap_align includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
json test: fix more legacy #include paths 2022-08-02 16:41:41 +01:00
mem_alloc includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
mem_blocks includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
mem_blocks_stats includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
mpsc_pbuf ztest: improve some tests 2022-09-09 07:05:38 -04:00
newlib includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
notify test: fix more legacy #include paths 2022-08-02 16:41:41 +01:00
onoff test: fix more legacy #include paths 2022-08-02 16:41:41 +01:00
p4workq includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
ringbuffer ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
smf includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
sprintf tests: lib: sprintf: migrating lib tests to new ZTEST API 2022-08-19 20:45:19 +00:00
spsc_pbuf ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
sys_util tests: lib: sysutil: migrating lib tests to new ZTEST API 2022-08-19 20:45:19 +00:00
time test: fix more legacy #include paths 2022-08-02 16:41:41 +01:00
uoscore includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00