Javinator9889 commented on PR #15331: URL: https://github.com/apache/nuttx/pull/15331#issuecomment-2561194727
To summarize and take note for the future (feel free to correct me if I'm wrong): * When building in `protected` and `kernel` modes, the `%m` modifier could be excluded from `libc` by introducing conditional compilation. * When in flat builds, the code is shared among the user and kernel space. The problem lies in the fact that the `vsprintf` functions would be using the `errno` variable which points to garbage when calling from the kernel, in any build. Additionally, the code is being shared between user and kernel spaces, making it impossible to differentiate whether the caller is the OS or not. Potential solutions may imply having kernel-only code for `vsprintf` and relatives, whereas the user space makes use of the POSIX standard functions - this is, the current code. Additionally, some work will be needed to either have a "kernel" `syslog` or to re-route functions that rely on `syslog/vsprintf/...` when in the kernel (ie.: assertion and core dump logic). _https://github.com/apache/nuttx/pull/15320#discussion_r1896798301_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
