-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snprintk used at many place while dummy build if CONFIG_PRINTK is undef #24181
Comments
Currently both Should this be in this issue or in another one? |
Sounds like a separate issue to me. IMHO best option would be to always have a full implementation of snprintk(). |
Thank for your reply. |
wait a second...snprintk does not depend on CONFIG_PRINTK what's the actual problem here?
I just checked and this code doesn't exist. Are you on some old version of Zephyr? |
@andrewboie You are correct, I've not correctly checked zephyr last version and therefore I've not see your commit that is fixing this issue. I'm sorry for the annoyance. |
Describe the bug
snprintk()
defined ininclude/sys/printk.h
has a dummy version in caseCONFIG_PRINTK
is not defined:However, it is used in many places (
git grep snprintk | wc
gives 213 matchs), including some that must not be "optimized" when logs are removed:To Reproduce
Build any project without
CONFIG_PRINTK
.To be sure, that it's not re-enable by (
CONFIG_BOOT_BANNER
for example) also removeCONFIG_CONSOLE
andCONFIG_LOG
.See that
snprintk()
as been "optimized" in generated.map
file.Expected behavior
snprintk()
should either be:snprintk()
dummy implementation to be a trampoline tosnprintf()
.printk.h
and only used in functions already optimized whenCONFIG_PRINTK
is not defined. This will force to change every call to snprintk() by snprintf().Impact
This become really dangerous if
CONFIG_PRINTK
is not defined.Environment :
The text was updated successfully, but these errors were encountered: