-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
lib/os: fix ll format specifier in z_prf #29171
Conversation
When z_prf moved from minimal libc to lib os a Kconfig option was missed, causing loss of the ability to display 64-bit values in the shell. Put it back with a better name. Signed-off-by: Peter Bigot <[email protected]>
Just enough to confirm that formating long-long works. Signed-off-by: Peter Bigot <[email protected]>
47056e8
to
71cbc5a
Compare
I must have missed the patch that moved z_prf out of minimal libc. |
that's fixing my problem. |
@andrewboie Not really. The requirements and rationale are in #27655: only This only affects things that explicitly use |
At any point did anyone consider that maybe we should change the shell code to not have this inflexible requirement such that any C library could be used, instead of us now having to support and maintain TWO printf implementations in the core kernel itself? |
From #27655 I don't see how to change the shell code: the shell requires generating output to arbitrary destinations, and there is no way to do that using the C standard library. If we want to eliminate duplicate code, we could convert In any case such discussion is not directly related to this PR which fixes a bug. |
So add some buffering or re-work the code so this isn't a requirement?
Not happening. z_prf uses far more stack space. You should really think about:
In other words, start over from first principles. IMO the other patch should be reverted. This is a mess. |
I will provide you with a path forward that I would find acceptable: |
Added to dev-review for tomorrow @galak. I have some sympathy with @andrewboie's concerns, but do not have time or interest in taking on other solution paths. My acceptable paths are (1) take this fix, (2) revert #27655 breaking shell display of floating point depending on which libc the app happens to link with, or (3) close this unmerged leaving the 64-bit shell printing broken. Changes like re-architecting the shell or trying to make |
I already sent a PR that does exactly this #29203
What is the point? @galak does not own lib/os. That is owned by me and Andy. This isn't up for discussion.
So be it. |
OK, didn't see that anywhere.
We had been using dev-review to get a wider perspective, but yes, I do agree that maintainers get to make decisions in the face of a lack of consensus. So we'll go with option 2. |
We should try as much as possible to close on such issues here and in related PRs and issues. Not everyone can join meetings and we should not use meetings for things that can be closed on GH.
@galak is just the facilitator of the meeting, do not shoot the messenger :-) |
Transfer the missed Kconfig that controls support for
%ll?
format specifier inz_prf
out of minimal libc and into the lib/os Kconfig area. Give it a better name, since it's not in minimal libc anymore.Also add just enough of a test case to verify this works.
Fixes #29165