a7224830ce
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> |
||
---|---|---|
.. | ||
src | ||
CMakeLists.txt | ||
README | ||
prj.conf | ||
testcase.yaml |